HTML renderer for special reStructuredText tree elements not part of the default document tree model.
The default rewrite rules that get applied to the raw document tree after parsing reStructuredText markup.
The default rewrite rules that get applied to the raw document tree after parsing reStructuredText markup. These rules are responsible for resolving substitution references and interpreted text which are specific to reStructuredText and get usually executed alongside the generic rules. .
Common base trait for reStructuredText extensions (directives and text roles).
Registry for custom reStructuredText extensions.
Registry for custom reStructuredText extensions. Application code can define any number of instances mixing in this trait and then pass them to Parse, Render or Transform operations:
object MyExtensions extends RstExtensionRegistry { val spanDirectives = Seq(...) val blockDirectives = Seq(...) val textRoles = Seq(...) } object OtherExtensions extends RstExtensionRegistry { [...] } Transform .from(ReStructuredText) .to(HTML) .using(MyDirectives, OtherDirectives) .fromFile("hello.rst") .toFile("hello.html")
In contrast to the original Python implementation, this API has been redesigned to be a more idiomatic, concise and type-safe Scala DSL. See the documentation for the methods of this trait for concrete examples on how to implement an extension.
The following extension types are available:
blockDirectives
method of this class to
add directive implementations to the parser. Specification entry:
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#directives|subst|
).
Use the spanDirectives
method of this class to
add directive implementations to the parser that can be used as substitution definitions.
Specification entry:
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#substitution-definitionstextRoles
method of this class to
add custom text role implementations to the parser that can be referred to by interpreted text.
Specification entry:
http://docutils.sourceforge.net/docs/ref/rst/directives.html#custom-interpreted-text-roles
Internal API that processes all extensions defined by one or more RstExtensionRegistries.
Internal API that processes all extensions defined by one or more RstExtensionRegistries. This extension is installed by default when using the reStructuredText parser.
Responsible for extracting a docInfo block at the start
of a reStructuredText document and inserting it into the
docInfo
element in the config object for that document.
Responsible for extracting a docInfo block at the start
of a reStructuredText document and inserting it into the
docInfo
element in the config object for that document.
See http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#bibliographic-fields.
Processes link targets in a sequence of blocks.
Processes link targets in a sequence of blocks.
In reStructuredText internal link targets provide the id of subsequent block items. This functions gets applied recursively to all block lists.
Registry for the standard extensions of ReStructuredText which allow for raw content pass-through.
Registry for the standard extensions of ReStructuredText which allow for
raw content pass-through. These have to be enabled to call withRawContent
on the Parse
or Transform
APIs:
Transform .from(ReStructuredText) .to(HTML) .withRawContent .fromFile("hello.rst") .toFile("hello.html")
Companion with utilities for initializing extensions.
Empty base instance as a basis for registering reStructuredText extensions.
Registry for all standard extensions of ReStructuredText as defined by the
specification, except for those which allow for raw content pass-through,
which are kept separately in RawContentExtensions
.
Registry for all standard extensions of ReStructuredText as defined by the
specification, except for those which allow for raw content pass-through,
which are kept separately in RawContentExtensions
.
See http://docutils.sourceforge.net/docs/ref/rst/directives.html for details.
This extension is installed by default when using the reStructuredText parser.
HTML renderer for special reStructuredText tree elements not part of the default document tree model.
The following tree elements are specific to reStructuredText and are not included in the default model:
FieldList
and corresponding child elementsOptionList
and corresponding child elementsDoctestBlock
FieldLists being part of a directive declaration will be processed by the default parser, the
FieldList
element only appears in the final document model if field lists are used outside of directives.The renderer must be applied explicitly when any of these constructs are used in the markup:
val transform = Transform from ReStructuredText to HTML rendering ExtendedHTMLRenderer