\phpDocumentor\Plugin\Scrybe\Converter\RestructuredTextToHtml

Class used to convert one or more RestructuredText documents to their HTML representation.

This class uses a two-phase process to interpret and parse the RestructuredText documents, namely Discovery and Creation.

Summary

Methods
Properties
Constants
__construct()
setLogger()
getAssets()
getTableOfContents()
getGlossary()
getDefinition()
setOption()
getOption()
configure()
convert()
getDestinationFilenameRelativeToProjectRoot()
No public properties found
No constants found
discover()
create()
addTemplateAssets()
getDestinationFilename()
getLogger()
setDestinationRoot()
$definition
$options
$fileset
$assets
$toc
$glossary
$logger
N/A
No private methods found
No private properties found
N/A

Properties

$options

$options : array<mixed,string>

Type

array<mixed,string>

$fileset

$fileset : \phpDocumentor\Fileset\Collection

Type

\phpDocumentor\Fileset\Collection

$logger

$logger : \Monolog\Logger

Type

\Monolog\Logger

Methods

__construct()

__construct(\phpDocumentor\Plugin\Scrybe\Converter\Definition\Definition  $definition, \phpDocumentor\Plugin\Scrybe\Converter\Metadata\Assets  $assets, \phpDocumentor\Plugin\Scrybe\Converter\Metadata\TableOfContents  $tableOfContents, \phpDocumentor\Plugin\Scrybe\Converter\Metadata\Glossary  $glossary) 

Initializes this converter and sets the definition.

Parameters

\phpDocumentor\Plugin\Scrybe\Converter\Definition\Definition $definition
\phpDocumentor\Plugin\Scrybe\Converter\Metadata\Assets $assets
\phpDocumentor\Plugin\Scrybe\Converter\Metadata\TableOfContents $tableOfContents
\phpDocumentor\Plugin\Scrybe\Converter\Metadata\Glossary $glossary

setLogger()

setLogger(\Monolog\Logger  $logger) : void

Set a logger for this converter.

Parameters

\Monolog\Logger $logger

setOption()

setOption(string  $name, string  $value) : void

Sets an option with the given name.

Parameters

string $name
string $value

getOption()

getOption(string  $name) : string|null

Returns the option with the given name or null if the option does not exist.

Parameters

string $name

Returns

string|null

configure()

configure() : void

Configures and initializes the subcomponents specific to this converter.

convert()

convert(\phpDocumentor\Fileset\Collection  $source, \phpDocumentor\Plugin\Scrybe\Template\TemplateInterface  $template) : array<mixed,string>|null

Converts the given $source using the formats that belong to this converter.

This method will return null unless the 'scrybe://result' is used.

Parameters

\phpDocumentor\Fileset\Collection $source

Collection of input files.

\phpDocumentor\Plugin\Scrybe\Template\TemplateInterface $template

Template used to decorate the output with.

Returns

array<mixed,string>|null

getDestinationFilenameRelativeToProjectRoot()

getDestinationFilenameRelativeToProjectRoot(\phpDocumentor\Fileset\File  $file) : string

Returns the filename relative to the Project Root of the fileset.

Parameters

\phpDocumentor\Fileset\File $file

Returns

string

discover()

discover() : void

Discovers the data that is spanning all files.

This method tries to find any data that needs to be collected before the actual creation and substitution phase begins.

Examples of data that needs to be collected during an initial phase is a table of contents, list of document titles for references, assets and more.

create()

create(\phpDocumentor\Plugin\Scrybe\Template\TemplateInterface  $template) : array<mixed,string>|null

Converts the input files into one or more output files in the intended format.

This method reads the files, converts them into the correct format and returns the contents of the conversion.

The template is provided using the $template parameter and is used to decorate the individual files. It can be obtained using the \phpDocumentor\Plugin\Scrybe\Template\Factory class.

Parameters

\phpDocumentor\Plugin\Scrybe\Template\TemplateInterface $template

Returns

array<mixed,string>|null —

The contents of the resulting file(s) or null if the files are written directly to file.

getDestinationFilename()

getDestinationFilename(\phpDocumentor\Fileset\File  $file) : string

Returns the filename used for the output path.

Parameters

\phpDocumentor\Fileset\File $file

Returns

string

getLogger()

getLogger() : \Monolog\Logger

Returns the logger for this converter.

Returns

\Monolog\Logger

setDestinationRoot()

setDestinationRoot(string  $destination) : void

Sets the relative path to the root of the generated contents.

Basically this method takes the depth of the given destination and replaces it with .. unless the destination directory name is ..

Parameters

string $destination

The destination path relative to the target folder.