Package

laika

bundle

Permalink

package bundle

Visibility
  1. Public
  2. All

Type Members

  1. class BlockParser extends AnyRef

    Permalink

    Builder API for block parsers.

  2. trait BlockParserBuilder extends ParserBuilder[BlockParserDefinition]

    Permalink

    Builds a block parser definition lazily by passing the recursive parsers of the host language.

  3. case class BlockParserDefinition(startChar: Option[Char], parser: Parser[Block], isRecursive: Boolean, position: BlockPosition, precedence: Precedence) extends ParserDefinition[Block] with Product with Serializable

    Permalink

    Defines a parser for a single kind of block element, like a quoted block or a bullet list for example.

    Defines a parser for a single kind of block element, like a quoted block or a bullet list for example.

    startChar

    the optional start character (allows performance optimizations when defined)

    parser

    the parser for the block element after the start character

    isRecursive

    indicates whether this parser produces child elements by recursively applying the parsers for the host language

    position

    indicates whether this parser is responsible for root or nested elements only, or for both

    precedence

    indicates whether the parser should be applied before the base parsers of the host language (high precedence) or after them

  4. sealed trait BlockPosition extends AnyRef

    Permalink

    Specifies the position a block element is allowed to appear in.

    Specifies the position a block element is allowed to appear in.

    RootOnly elements can only appear on the top level of the document hierarchy, while NestedOnly can only appear nested within other elements, e.g. as part of a list item or within a quoted block. Any allows block elements in any position.

  5. trait ExtensionBundle extends AnyRef

    Permalink

    An extension bundle is a collection of parser extensions, rewrite rules, render themes and other features to be applied to parse, render and transform operations.

    An extension bundle is a collection of parser extensions, rewrite rules, render themes and other features to be applied to parse, render and transform operations. It serves as a central registry for all of Laika's extension and customization hooks.

    The base trait contains empty implementations for all these features, therefore any bundle implementation only needs to override the relevant members.

    If the bundle implementation is not parameterized, the most convenient choice for users would be to simply implement it as an object, like all built-in extensions do:

    object MyExtensions extends ExtensionBundle {
    
      // override one or more members
    
    }

    This way a user can easily pass it to the operation builders:

    Transform
      .from(Markdown).to(HTML)
      .using(MyExtensions)
      .fromFile("hello.md").toFile("hello.html")
  6. case class MarkupExtensions(blockParsers: Seq[BlockParserBuilder], spanParsers: Seq[SpanParserBuilder], parserHooks: ParserHooks) extends Product with Serializable

    Permalink

    Bundles extensions for the text markup parsers defined for the host language to support additional syntax not recognized by the base parsers.

    Bundles extensions for the text markup parsers defined for the host language to support additional syntax not recognized by the base parsers.

    When extension parsers fail for a given input the built-in parsers will still be tried for the same block or span respectively.

    blockParsers

    parsers for block elements in text markup, complementing the parsers of the host language

    spanParsers

    parsers for span elements in text markup, complementing the parsers of the host language

    parserHooks

    hooks for markup parsers to control aspects beyond the individual span and block parsers

  7. sealed trait ParserBuilder[T <: ParserDefinition[_]] extends AnyRef

    Permalink

    Builds a parser definition lazily by passing the recursive parsers of the host language.

    Builds a parser definition lazily by passing the recursive parsers of the host language.

    This indirection is needed when supplying parser implementations as many parsers recursively parse child elements. A list parser for example needs to be able to detect any other block or span element within a list item. But since it has no way of knowing which extensions a user might have added to the host language, those parsers are supplied from the outside by the parser engine.

  8. case class ParserBundle(blockParsers: Seq[BlockParserBuilder] = Nil, spanParsers: Seq[SpanParserBuilder] = Nil, markupParserHooks: Option[ParserHooks] = None, configHeaderParsers: Seq[(Path) ⇒ Parser[Either[InvalidElement, Config]]] = Nil, templateParser: Option[Parser[TemplateRoot]] = None, styleSheetParser: Option[Parser[Set[StyleDeclaration]]] = None) extends Product with Serializable

    Permalink

    Bundles a collection of all types of parsers used in a transformation.

    Bundles a collection of all types of parsers used in a transformation.

    The parsers for text markup and configuration headers are meant to complement base parsers defined by the host language. If they fail for a given input the built-in parsers will still be tried for the same block, span or configuration header respectively.

    The parsers for stylesheets and templates on the other hand are meant to overwrite any previously installed parsers.

    blockParsers

    parsers for block elements in text markup, complementing the parsers of the host language

    spanParsers

    parsers for span elements in text markup, complementing the parsers of the host language

    markupParserHooks

    hooks for markup parsers to control aspects beyond the individual span and block parsers

    configHeaderParsers

    parser for configuration headers in text markup and template documents

    templateParser

    parser for template documents

    styleSheetParser

    parser for CSS documents

  9. sealed trait ParserDefinition[E <: Element] extends AnyRef

    Permalink

    Defines a parser for a single kind of text markup, like a literal text span or a bullet list for example.

  10. case class ParserHooks(postProcessBlocks: (Seq[Block]) ⇒ Seq[Block] = identity, postProcessDocument: (Document) ⇒ Document = identity, preProcessInput: (Input) ⇒ Input = identity) extends Product with Serializable

    Permalink

    Hooks for markup parsers to control aspects beyond the individual span and block parsers defined for the host language.

    Hooks for markup parsers to control aspects beyond the individual span and block parsers defined for the host language.

    postProcessBlocks

    function invoked for every block container, allowing post-processing of the result

    postProcessDocument

    function invoked after parsing but before rewriting, allowing to modify the document

    preProcessInput

    function invoked before parsing, allowing to pre-process the input

  11. sealed trait Precedence extends AnyRef

    Permalink

    Indicates whether a parser should be applied before the base parsers of the host language (high precedence) or after them (low precedence).

  12. trait RenderTheme extends AnyRef

    Permalink

    Collects templates, styles and custom render functions to form a theme for a specific output format.

  13. class SpanParser extends AnyRef

    Permalink

    Builder API for span parsers.

  14. trait SpanParserBuilder extends ParserBuilder[SpanParserDefinition]

    Permalink

    Builds a span parser definition lazily by passing the recursive parsers of the host language.

  15. case class SpanParserDefinition(startChar: Char, parser: Parser[Span], isRecursive: Boolean, precedence: Precedence) extends ParserDefinition[Span] with Product with Serializable

    Permalink

    Defines a parser for a single kind of span element, like a literal text span or a link reference for example.

    Defines a parser for a single kind of span element, like a literal text span or a link reference for example.

    startChar

    the start character (allows performance optimizations)

    parser

    the parser for the span element after the start character

    isRecursive

    indicates whether this parser produces child elements by recursively applying the parsers for the host language

    precedence

    indicates whether the parser should be applied before the base parsers of the host language (high precedence) or after them

  16. case class StaticDocuments(tree: DocumentTree) extends Product with Serializable

    Permalink

    A collection of static documents to be copied over to the target directory in each transform operation.

    A collection of static documents to be copied over to the target directory in each transform operation.

    This is allows for a central collection of CSS, JavaScript, image and other files needed for a specific theme.

Value Members

  1. object BlockParser

    Permalink

    Builder API for block parsers.

  2. object BlockPosition

    Permalink
  3. object ConfigImplicits

    Permalink

    Extension methods for Typesafe Config instances.

  4. object ConfigProvider

    Permalink

    Factory for Typesafe Config instances that add information about the virtual path of the configuration within a Laika document tree.

  5. object DocumentTypeMatcher

    Permalink

    The default implementations for determining the document type of the input based on its path.

  6. object ExtensionBundle

    Permalink

    Provides default ExtensionBundle instances.

  7. object Precedence

    Permalink
  8. object RewriteRules

    Permalink

    Utilities for dealing with rewrite rules.

  9. object SpanParser

    Permalink

    Builder API for span parsers.

  10. object StaticDocuments extends InputTreeOps with Serializable

    Permalink

    API for defining a collection of static documents based on one or more directories.

    API for defining a collection of static documents based on one or more directories.

    Like with all Laika IO, these may be actual file system directories or virtual in-memory trees of input documents.

Ungrouped