Package

laika.rst

bundle

Permalink

package bundle

Visibility
  1. Public
  2. All

Type Members

  1. class ExtendedHTMLRenderer extends (HTMLWriter) ⇒ RenderFunction

    Permalink

    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 elements
    • OptionList and corresponding child elements
    • DoctestBlock

    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
  2. class RewriteRules extends (DocumentCursor) ⇒ RewriteRule

    Permalink

    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. .

  3. trait RstExtension[P] extends AnyRef

    Permalink

    Common base trait for reStructuredText extensions (directives and text roles).

  4. trait RstExtensionRegistry extends ExtensionBundle

    Permalink

    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:

  5. class RstExtensionSupport extends ExtensionBundle

    Permalink

    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.

Value Members

  1. object DocInfoExtractor extends (Document) ⇒ Document

    Permalink

    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.

  2. object ExtendedHTMLRenderer extends ExtendedHTMLRenderer

    Permalink
  3. object LinkTargetProcessor extends (Seq[Block]) ⇒ Seq[Block]

    Permalink

    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.

  4. object RawContentExtensions extends RstExtensionRegistry

    Permalink

    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")
  5. object RstExtension

    Permalink

    Companion with utilities for initializing extensions.

  6. object RstExtensionSupport extends RstExtensionSupport

    Permalink

    Empty base instance as a basis for registering reStructuredText extensions.

  7. object StandardExtensions extends RstExtensionRegistry

    Permalink

    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.

Ungrouped