Package

laika.rst

std

Permalink

package std

Visibility
  1. Public
  2. All

Type Members

  1. class StandardBlockDirectives extends AnyRef

    Permalink

    Defines all supported standard block directives of the reStructuredText reference parser.

    Defines all supported standard block directives of the reStructuredText reference parser.

    The following directives are fully supported:

    • compound
    • container
    • admonition
    • attention
    • caution
    • danger
    • error
    • hint
    • important
    • note
    • tip
    • warning
    • topic
    • sidebar
    • rubric
    • epigraph
    • highlights
    • pull-quote
    • parsed-literal
    • table
    • contents
    • sectnum
    • figure
    • image
    • header
    • footer
    • title
    • meta

    The following directives are supported with some limitations:

    • code does currently not support syntax highlighting (it allows to set the language so client-side highlighters can be integrated if required)
    • sectnum does currently not support the prefix, suffix and start options.
    • raw does not support the file or url options.
    • include does not support any of the options apart from the filename. See the API entry for this directive for details.

    Finally, for some directives there is currently no support planned:

    • math (would require external tools)
    • csv-table, list-table (would just require some work, contributions are welcome)
    • target-notes, class (these would require processing beyond the directive itself, therefore would require new API)
  2. class StandardSpanDirectives extends AnyRef

    Permalink

    Defines all supported standard span directives of the reStructuredText reference parser.

    Defines all supported standard span directives of the reStructuredText reference parser. A span directive can be used in substitution definitions.

    The replace directive is fully supported. The other directives have the following adjustments or limitations compared to their counterparts in the reference parser:

    • unicode: does not support the various trim options, as that would require modifying adjacent elements (and no other directive has this requirement, therefore API/impl changes did not seem justified)
    • date: Uses the patterns of java.text.SimpleDateFormat instead of Python's time.strftime function.
    • image: Does not support the various layout options (width, height, scale, align), as no other tree nodes in Laika carry concrete layout information. It is recommended to use styles instead.
  3. class StandardTextRoles extends AnyRef

    Permalink

    Defines all supported standard text roles of the reStructuredText reference parser.

    Defines all supported standard text roles of the reStructuredText reference parser.

    The following text roles are fully supported:

    • emphasis
    • strong
    • literal
    • subscript (and sub alias)
    • superscript (and sup alias)
    • title-reference (and title alias) - the default role
    • raw (+ format option) (needs to be enabled explicitly through ReStructuredText.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 = Transform from ReStructuredText to HTML using RstExtensions

    See http://docutils.sourceforge.net/docs/ref/rst/roles.html for details.

Value Members

  1. object StandardDirectiveParsers

    Permalink

    Defines the custom argument and body parsers for the standard directives.

    Defines the custom argument and body parsers for the standard directives. Most of these delegate to the default block or inline parsers for reStructuredText, but often do only except one specific block type like Table or QuotedBlock whereas the default block parser usually accepts any of the blocks.

  2. object StandardDirectiveParts

    Permalink

Ungrouped