PHP Class PressBooks\Modules\Export\Xhtml\Xhtml11

Inheritance: extends Pressbooks\Modules\Export\Export
Mostra file Open project: pressbooks/pressbooks Class Usage Examples

Public Properties

Property Type Description
$timeout integer Used with wp_remote_get()
$url string Service URL

Protected Properties

Property Type Description
$endnotes array Use when overriding the footnote shortcode.
$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

Public Methods

Method Description
__construct ( array $args )
convert ( ) : boolean Create $this->outputPath
doEndnotes ( $id ) : string Style endnotes.
endnoteShortcode ( array $atts, null $content = null ) : string Convert footnotes to endnotes by moving them to the end of the_content()
footnoteShortcode ( $atts, null $content = null ) : string Wrap footnotes for Prince compatibility
hasDependencies ( ) : boolean Dependency check.
logError ( $message, array $more_info = [] ) Add $this->url as additional log info, fallback to parent.
transform ( ) Procedure for "format/xhtml" rewrite rule.
validate ( ) : boolean Check the sanity of $this->outputPath

Protected Methods

Method Description
atLeastOneExport ( array $chapters ) : boolean Does array of chapters have at least one export? Recursive.
createPromo ( array $book_contents, array $metadata )
echoBackMatter ( array $book_contents, array $metadata )
echoBeforeTitle ( array $book_contents, array $metadata )
echoCopyright ( array $book_contents, array $metadata )
echoCover ( array $book_contents, array $metadata )
echoDedicationAndEpigraph ( array $book_contents, array $metadata )
echoDocType ( array $book_contents, array $metadata )
echoFrontMatter ( array $book_contents, array $metadata )
echoHalfTitle ( array $book_contents, array $metadata )
echoMetaData ( array $book_contents, array $metadata )
echoPartsAndChapters ( array $book_contents, array $metadata )
echoTitle ( array $book_contents, array $metadata )
echoToc ( array $book_contents, array $metadata )
fixInternalLinks ( string $content ) : string
preProcessBookContents ( $book_contents ) : mixed
preProcessPostContent ( string $content ) : string
queryXhtml ( ) : boolean | string Query the access protected "format/xhtml" URL, return the results.
switchLaTexFormat ( string $content ) Replace links to QuickLaTex PNG files with links to the corresponding SVG files.
tidy ( string $html ) : string Tidy HTML

Method Details

__construct() public method

public __construct ( array $args )
$args array

atLeastOneExport() protected method

Does array of chapters have at least one export? Recursive.
protected atLeastOneExport ( array $chapters ) : boolean
$chapters array
return boolean

convert() public method

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

createPromo() protected method

protected createPromo ( array $book_contents, array $metadata )
$book_contents array
$metadata array

doEndnotes() public method

Style endnotes.
See also: endnoteShortcode
public doEndnotes ( $id ) : string
$id
return string

echoBackMatter() protected method

protected echoBackMatter ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoBeforeTitle() protected method

protected echoBeforeTitle ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoCopyright() protected method

protected echoCopyright ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoCover() protected method

protected echoCover ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoDedicationAndEpigraph() protected method

protected echoDedicationAndEpigraph ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoDocType() protected method

protected echoDocType ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoFrontMatter() protected method

protected echoFrontMatter ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoHalfTitle() protected method

protected echoHalfTitle ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoMetaData() protected method

protected echoMetaData ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoPartsAndChapters() protected method

protected echoPartsAndChapters ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoTitle() protected method

protected echoTitle ( array $book_contents, array $metadata )
$book_contents array
$metadata array

echoToc() protected method

protected echoToc ( array $book_contents, array $metadata )
$book_contents array
$metadata array

endnoteShortcode() public method

Convert footnotes to endnotes by moving them to the end of the_content()
See also: doEndnotes
public endnoteShortcode ( array $atts, null $content = null ) : string
$atts array
$content null
return string

footnoteShortcode() public method

Wrap footnotes for Prince compatibility
See also: http://www.princexml.com/doc/8.1/footnotes/
public footnoteShortcode ( $atts, null $content = null ) : string
$atts
$content null
return string

hasDependencies() static public method

Dependency check.
static public hasDependencies ( ) : boolean
return boolean

logError() public method

Add $this->url as additional log info, fallback to parent.
public logError ( $message, array $more_info = [] )
$message
$more_info array (unused, overridden)

preProcessBookContents() protected method

protected preProcessBookContents ( $book_contents ) : mixed
$book_contents
return mixed

preProcessPostContent() protected method

protected preProcessPostContent ( string $content ) : string
$content string
return string

queryXhtml() protected method

Query the access protected "format/xhtml" URL, return the results.
protected queryXhtml ( ) : boolean | string
return boolean | string

switchLaTexFormat() protected method

Replace links to QuickLaTex PNG files with links to the corresponding SVG files.
protected switchLaTexFormat ( string $content )
$content string The section content.

tidy() protected method

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

transform() public method

Procedure for "format/xhtml" rewrite rule.
public transform ( )

validate() public method

Check the sanity of $this->outputPath
public validate ( ) : boolean
return boolean

Property Details

$endnotes protected_oe property

Use when overriding the footnote shortcode.
protected array $endnotes
return array

$frontMatterPos protected_oe property

Keep track of where we are using this variable.
protected int $frontMatterPos
return integer

$hasIntroduction protected_oe property

Sometimes the user will omit an introduction so we must inject the style in either the first part or the first chapter ourselves.
protected bool $hasIntroduction
return boolean

$lang protected_oe property

Main language of document, two letter code
protected string $lang
return string

$timeout public_oe property

Used with wp_remote_get()
public int $timeout
return integer

$url public_oe property

Service URL
public string $url
return string