Property | Type | Description | |
---|---|---|---|
$timeout | integer | Used with wp_remote_get() |
Property | Type | Description | |
---|---|---|---|
$compressImages | boolean | ||
$coverImage | string | Used to set cover-image in OPF for kindlegen compatibility. | |
$cssOverrides | string | CSS overrides | |
$dir | $var string | ||
$exportStylePath | string | Fullpath to book CSS file. | |
$extraCss | string | Extra CSS (to be used by child classes if necessary) | |
$fetchedFontCache | array | ||
$fetchedImageCache | array | ||
$filext | string | ||
$fixme | array | Used by HtmLawed with $GLOBALS['hl_Ids'] | |
$frontMatterLastPos | integer | boolean | Last known front matter position. Used to insert the TOC in the correct place. | |
$frontMatterPos | integer | Keep track of where we are using this variable. | |
$hasIntroduction | boolean | Sometimes the user will omit an introduction so we must inject the style in either the first part or the first chapter ourselves. | |
$lang | string | Main language of document, two letter code | |
$manifest | array | Generated by createOEPBS(), used by createToc(), createOPF(), and creatdNCX() Note: Only XHTML files go in the manifest array (images are done automatically) | |
$numbered | boolean | ||
$romanizePartNumbers | boolean | Hack to romanize part numbers | |
$stylesheet | string | ||
$suffix | $var string | ||
$supportedFontExtensions | string | Regular expression for supported fonts (used in #($supportedFontExtensions)#i') | |
$supportedImageExtensions | string | Regular expression for supported images (used in #($supportedImageExtensions)#i') | |
$tmpDir | string | Temporary directory used to build EPUB, no trailing slash! |
Method | Description | |
---|---|---|
__construct ( array $args ) | ||
__destruct ( ) | Delete temporary directory when done. | |
convert ( ) : boolean | Create $this->outputPath | |
fixAnnoyingCharacters ( string $html ) : string | void | Fix annoying characters that the user probably didn't do on purpose | |
hasDependencies ( ) : boolean | Dependency check. | |
mediaType ( string $file ) : mixed | string | Override mimeType, get rid of '; charset=binary' | |
validate ( ) : boolean | Check the sanity of $this->outputPath |
Method | Description | |
---|---|---|
buildManifestAssetsHtml ( ) : string | Find all the image files, insert them into the OPF file | |
createBackMatter ( array $book_contents, array $metadata ) | ||
createBeforeTitle ( array $book_contents, array $metadata ) | ||
createContainer ( ) | Create Open Publication Structure 2.0.1 container. | |
createCopyright ( array $book_contents, array $metadata ) | ||
createCover ( array $book_contents, array $metadata ) | ||
createDedicationAndEpigraph ( array $book_contents, array $metadata ) | ||
createFrontMatter ( array $book_contents, array $metadata ) | ||
createNCX ( array $book_contents, array $metadata ) | Create NCX file. | |
createOEPBS ( array $book_contents, array $metadata ) | Create OEBPS/* files. | |
createOPF ( array $book_contents, array $metadata ) | Create OPF File. | |
createPartsAndChapters ( array $book_contents, array $metadata ) | ||
createPromo ( array $book_contents, array $metadata ) | ||
createStylesheet ( ) | Create stylesheet. Change $this->stylesheet to a filename used by subsequent methods. | |
createTitle ( array $book_contents, array $metadata ) | ||
createToc ( array $book_contents, array $metadata ) | Uses $this->manifest to generate itself. | |
deleteTmpDir ( ) | Create a temporary directory | |
fetchAndSaveUniqueFont ( $url, $fullpath ) : string | Fetch a font with wp_remote_get(), save it to $fullpath with a unique name. | |
fetchAndSaveUniqueImage ( $url, $fullpath ) : string | Fetch an image with wp_remote_get(), save it to $fullpath with a unique name. | |
fuzzyHrefMatch ( $url, string $type, integer $pos ) : boolean | string | Try to determine if a URL is pointing to internal content. TODO: Refactor, for the love of all that is holy. | |
fuzzyImageNameMatch ( string $file1, string $file2 ) : boolean | Fuzzy image name match. | |
kneadHref ( DOMDocument $doc, string $type, integer $pos ) : DOMDocument | Change hrefs | |
kneadHtml ( string $html, string $type, integer $pos ) : string | Pummel the HTML into EPUB compatible dough. | |
positionOfToc ( ) : integer | Determine position of TOC based on Chicago Manual Of Style. | |
preProcessBookContents ( $book_contents ) : mixed | ||
preProcessPostContent ( string $content ) : string | ||
scrapeAndKneadImages ( DOMDocument $doc ) : DOMDocument | Parse HTML snippet, download all found tags into /OEBPS/assets/, return the HTML with changed paths. | |
scrapeAndKneadMedia ( DOMDocument $doc ) : DOMDocument | This is a stub for an Epub3 feature Do nothing | |
scrapeKneadAndSaveCss ( string $path_to_original_stylesheet, string $path_to_copy_of_stylesheet ) | Parse CSS, copy assets, rewrite copy. | |
themeOptionsOverrides ( ) | Override based on Theme Options | |
tidy ( string $html ) : string | Tidy HTML | |
zipEpub ( $filename ) : boolean | Zip the contents of an EPUB following the conventions outlined in Open Publication Structure 2.0.1 |
protected buildManifestAssetsHtml ( ) : string | ||
return | string |
protected createBackMatter ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected createBeforeTitle ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected createContainer ( ) |
protected createCopyright ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected createCover ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected createDedicationAndEpigraph ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected createFrontMatter ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected createOEPBS ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected createPartsAndChapters ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected createPromo ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected createStylesheet ( ) |
protected createTitle ( array $book_contents, array $metadata ) | ||
$book_contents | array | |
$metadata | array |
protected fetchAndSaveUniqueFont ( $url, $fullpath ) : string | ||
$url | string | |
$fullpath | string | |
return | string | filename |
protected fetchAndSaveUniqueImage ( $url, $fullpath ) : string | ||
$url | string | |
$fullpath | string | |
return | string | filename |
static public hasDependencies ( ) : boolean | ||
return | boolean |
protected positionOfToc ( ) : integer | ||
return | integer |
protected preProcessBookContents ( $book_contents ) : mixed | ||
$book_contents | ||
return | mixed |
protected preProcessPostContent ( string $content ) : string | ||
$content | string | |
return | string |
protected scrapeAndKneadImages ( DOMDocument $doc ) : DOMDocument | ||
$doc | DOMDocument | |
return | DOMDocument |
protected scrapeAndKneadMedia ( DOMDocument $doc ) : DOMDocument | ||
$doc | DOMDocument | |
return | DOMDocument |
protected scrapeKneadAndSaveCss ( string $path_to_original_stylesheet, string $path_to_copy_of_stylesheet ) | ||
$path_to_original_stylesheet | string | * |
$path_to_copy_of_stylesheet | string |
protected themeOptionsOverrides ( ) |
protected string $coverImage | ||
return | string |
protected string $exportStylePath | ||
return | string |
protected string $extraCss | ||
return | string |
protected array $fixme | ||
return | array |
protected int $frontMatterPos | ||
return | integer |
protected bool $hasIntroduction | ||
return | boolean |
protected string $lang | ||
return | string |
protected array $manifest | ||
return | array |
protected bool $romanizePartNumbers | ||
return | boolean |
protected string $supportedFontExtensions | ||
return | string |
protected string $supportedImageExtensions | ||
return | string |
protected string $tmpDir | ||
return | string |