laika.rst.bundle
Type members
Classlikes
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.
HTML renderer for special reStructuredText tree elements not part of the default document tree model.
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.
- Companion:
- object
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. These have to be enabled to call withRawContent
on the Parse
or Transform
APIs:
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:
val transformer = Transformer
.from(ReStructuredText)
.to(HTML)
.withRawContent
.build
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. .
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).
Common base trait for reStructuredText extensions (directives and text roles).
- Companion:
- object
Companion with utilities for initializing extensions.
Companion with utilities for initializing extensions.
- Companion:
- class
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:
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 {
[...]
}
val transformer = Transformer
.from(ReStructuredText)
.to(HTML)
.using(MyDirectives, OtherDirectives)
.build
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:
-
Block Directives - an extension hook for adding new block level elements to reStructuredText markup. Use the
blockDirectives
method of this class to add directive implementations to the parser. Specification entry: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#directives -
Substitution Definitions - an extension hook for adding new span level elements to reStructuredText markup that can be used by substitution references (like
|subst|
). Use thespanDirectives
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-definitions -
Interpreted Text Roles - an extension hook for adding new dynamic span level elements to reStructuredText markup. In contrast to substitution definitions the implementation of a text role uses the text from the occurrences in the markup referring to the role as input. Use the
textRoles
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. This extension is installed by default when using the reStructuredText parser.
Internal API that processes all extensions defined by one or more RstExtensionRegistries. This extension is installed by default when using the reStructuredText parser.
- Companion:
- object
Empty base instance as a basis for registering reStructuredText extensions.
Empty base instance as a basis for registering reStructuredText extensions.
- Companion:
- class
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.