Configuration
Base URL
Normally, all URLs are generated relative, but if you want to generate absolute URLs
with a base url, you can use the baseUrl
option:
1 $configuration->setBaseUrl('https://www.doctrine-project.org');
Base URL Enabled Callable
In some cases, you may want to control when the base url gets used. For this you can set a callable that will be invoked when generating URLs. The callable receives a string that contains the path to the current file being rendered. This means you could make the parser only use the base url on certain paths:
Abort on Error
By default if an error is encountered, the parsing will be aborted. You can easily change this like this:
1 $configuration->abortOnError(false);
Ignoring Invalid References
By default, invalid references and links will be reported as errors. If you want to ignore them you can do so like this:
1 $configuration->setIgnoreInvalidReferences(true);
Format
By default, the Doctrine RST Parser comes with two formats, HTML and LaTeX. HTML is the default format and you can configure which format to use by using the following constants:
Doctrine\RST\Formats\Format::HTML
Doctrine\RST\Formats\Format::LATEX
And you can configure the format to render like this:
You can read more about formats in the Formats chapter.
Indent HTML
By default, the outputted HTML is not indented consistently. If you would like the outputted HTML to be
indented consistently, you can enable this feature using the setIndentHTML(bool $indentHTML)
method:
1 $configuration->setIndentHTML(true);
This feature only works when rendering full HTML documents using the
|
Initial Header Level
Normally, document headings start at h1
. You can override this by setting the initialHeaderLevel
configuration
option: