PHP Class Pressbooks\Modules\Export\Epub\Epub3

Inheritance: extends Epub201
Show file Open project: pressbooks/pressbooks

Protected Properties

Property Type Description
$MathMLTags array MathML Tags
$dir $var string
$fetchedMediaCache array
$filext string
$javaScriptEvents array JavaScript Events
$suffix $var string
$supportedFontExtensions string Regular expression for supported fonts (used in /($supportedFontExtensions)/i')

Public Methods

Method Description
convert ( ) : boolean Create $this->outputPath

Protected Methods

Method Description
createNCX ( array $book_contents, array $metadata ) Create NCX file.
createOPF ( array $book_contents, array $metadata ) Create OPF File.
fetchAndSaveUniqueMedia ( string $url, string $fullpath ) : string | array Fetch a url with wp_remote_get(), save it to $fullpath with a unique name.
getProperties ( string $html_file ) : array Check for existence of properties attributes
isMathML ( string $html ) : boolean Check for existence of scripting MathML elements
isScripted ( string $html ) : boolean Check for existence of scripting elements
loadTemplate ( string $path, array $vars = [] ) : string Override load template function Switch path from /epub201 to /epub3 when possible.
scrapeAndKneadMedia ( DOMDocument $doc ) : DOMDocument Parse HTML snippet, download all found
tidy ( string $html ) : string Tidy HTML

Method Details

convert() public method

Create $this->outputPath
public convert ( ) : boolean
return boolean

createNCX() protected method

Create NCX file.
protected createNCX ( array $book_contents, array $metadata )
$book_contents array
$metadata array

createOPF() protected method

Create OPF File.
protected createOPF ( array $book_contents, array $metadata )
$book_contents array
$metadata array

fetchAndSaveUniqueMedia() protected method

Will return an empty string if something went wrong.
protected fetchAndSaveUniqueMedia ( string $url, string $fullpath ) : string | array
$url string
$fullpath string
return string | array

getProperties() protected method

Check for existence of properties attributes
protected getProperties ( string $html_file ) : array
$html_file string
return array $properties

isMathML() protected method

Check for existence of scripting MathML elements
protected isMathML ( string $html ) : boolean
$html string
return boolean

isScripted() protected method

Check for existence of scripting elements
protected isScripted ( string $html ) : boolean
$html string
return boolean

loadTemplate() protected method

Override load template function Switch path from /epub201 to /epub3 when possible.
protected loadTemplate ( string $path, array $vars = [] ) : string
$path string
$vars array (optional)
return string

scrapeAndKneadMedia() protected method

Parse HTML snippet, download all found
protected scrapeAndKneadMedia ( DOMDocument $doc ) : DOMDocument
$doc DOMDocument
return DOMDocument

tidy() protected method

Tidy HTML
protected tidy ( string $html ) : string
$html string
return string

Property Details

$MathMLTags protected property

MathML Tags
protected array $MathMLTags
return array

$dir protected property

$var string
protected $dir

$fetchedMediaCache protected property

protected array $fetchedMediaCache
return array

$filext protected property

protected string $filext
return string

$javaScriptEvents protected property

JavaScript Events
protected array $javaScriptEvents
return array

$suffix protected property

$var string
protected $suffix

$supportedFontExtensions protected property

Regular expression for supported fonts (used in /($supportedFontExtensions)/i')
protected string $supportedFontExtensions
return string