StandardTextRoles
Defines all supported standard text roles of the reStructuredText reference parser.
The following text roles are fully supported:
emphasis
strong
literal
subscript
(andsub
alias)superscript
(andsup
alias)title-reference
(andtitle
alias) - the default roleraw
(+ format option) (needs to be enabled explicitly throughReStructuredText.withRawElements
)
The following text role is supported with some limitation:
code
does currently not support syntax highlighting (it allows to set the language so client-side highlighters can be integrated if required)
The following text roles are not supported:
math
pep-reference
rfc-reference
In contrast to the reference parser the default-role
directive cannot be supported
in Laika as the parser is not stateful. Therefore it is not possible to change the
default role half-way through a parsing process. However the default role can be specified
through the API when creating a parser instance:
object RstExtensions extends RstExtensionRegistry {
val blockDirectives = Nil
val spanDirectives = Nil
val textRoles = Nil
override val defaultTextRole = "my-role-name"
}
val transformer = Transformer.from(ReStructuredText).to(HTML).using(RstExtensions)
See http://docutils.sourceforge.net/docs/ref/rst/roles.html for details.
Value members
Concrete fields
All standard text roles currently supported by Laika, except for
the raw
text role which needs to be enabled explicitly.
All standard text roles currently supported by Laika, except for
the raw
text role which needs to be enabled explicitly.
The standard code text role. The current implementation does not support syntax highlighting.
The standard code text role. The current implementation does not support syntax highlighting.
The raw text role, which is not enabled by default,
see http://docutils.sourceforge.net/docs/ref/rst/roles.html#raw for details.
It can be enabled with Transformer.from(ReStructuredText).to(HTML).withRawContent
.
The raw text role, which is not enabled by default,
see http://docutils.sourceforge.net/docs/ref/rst/roles.html#raw for details.
It can be enabled with Transformer.from(ReStructuredText).to(HTML).withRawContent
.
The sub text role, an alias for the subscript role.
The sub text role, an alias for the subscript role.
The sup text role, an alias for the superscript role.
The sup text role, an alias for the superscript role.
The title text role, an alias for the title-reference role.
The title text role, an alias for the title-reference role.