trait ExtensionBundle extends AnyRef

An extension bundle is a collection of parser extensions, rewrite rules, render overrides 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:

val transformer = Transformer
  .from(Markdown)
  .to(HTML)
  .using(MyExtensions)
  .build
Self Type
ExtensionBundle
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ExtensionBundle
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def description: String

    Short string describing the extension for tooling and logging.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def acceptRawContent: Boolean

    Indicates that this bundle deals with raw content embedded in text markup, like HTML.

    Indicates that this bundle deals with raw content embedded in text markup, like HTML.

    These kind of bundles are disabled by default as Laika is designed to render to multiple output formats from a single input document. With raw content embedded the markup document is tied to a specific output format.

    Bundles which have this flag set to true need to be enabled explicitly by the user by calling withRawContent on the Parse or Transform API:

    val transformer = Transformer.from(Markdown).to(HTML).withRawContent.build
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def baseConfig: Config

    Base configuration that serves as a fallback for configuration files in the source directories and/or config headers in markup and template documents.

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def docTypeMatcher: PartialFunction[Path, DocumentType]

    Specifies the function to use for determining the document type of the input based on its path.

    Specifies the function to use for determining the document type of the input based on its path.

    Any path for which this function is not defined will be processed by the remaining defined bundles. The documents for paths for which none of the extensions provides a DocumentType will be treated as static files to be copied over to the target directory in transformations by default.

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. def origin: BundleOrigin

    Indicates whether the bundle is a built-in default provided by the library, a collection of extensions installed by a markup format or user-defined.

    Indicates whether the bundle is a built-in default provided by the library, a collection of extensions installed by a markup format or user-defined.

    This is relevant for determining the precedence of installed bundles when merging them, as user-supplied functionality always overrides library defaults.

  19. def parsers: ParserBundle

    Specifies extensions and/or replacements for parsers that deal with text markup, templates, CSS or configuration headers.

  20. def processExtension: PartialFunction[ExtensionBundle, ExtensionBundle]

    Internal API usually only called by other extension bundles.

    Internal API usually only called by other extension bundles.

    In some cases a bundle might be an extension of another bundle and needs the opportunity to process and modify that bundle without requiring a direct reference to it. An example is a registry for directives which needs to pass all its registered directives to the bundle which deals with finally creating all the directive parsers.

    The partial function should match only on the types of bundles it intends to process and is then allowed to return a new, modified instance of that bundle.

  21. def renderOverrides: Seq[RenderOverrides]

    The overrides for renderers defined by this bundle.

    The overrides for renderers defined by this bundle.

    An override is always specific to a particular output format like HTML or PDF. A bundle can contain multiple overrides for the same output format which will be merged before use.

  22. def rewriteRules: Seq[RewriteRulesBuilder]

    Specifies rewrite rules to be applied to the document tree model between the parse and render operations.

    Specifies rewrite rules to be applied to the document tree model between the parse and render operations.

    The specified functions will be invoked for each document, allowing to capture information from the entire document tree before returning the actual rule, which is a partial function from Element to Option[Element] that allows to remove or replace elements from the tree.

  23. def slugBuilder: Option[(String) ⇒ String]

    Function that receives the text of a headline, the name of a document or directory or a manually assigned identifier, and builds a slug from it that becomes part of the final URL or identifier (depending on output format).

    Function that receives the text of a headline, the name of a document or directory or a manually assigned identifier, and builds a slug from it that becomes part of the final URL or identifier (depending on output format).

    The result of the function must be:

    - a valid identifier in HTML and XML - a valid path segment in a URL - a valid file name

  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. def useInStrictMode: Boolean

    Indicates that this bundle should still be used if the user runs a transformation in strict mode.

    Indicates that this bundle should still be used if the user runs a transformation in strict mode.

    This setting is appropriate if a bundle contains features which are native elements of a text markup language as defined in its specification, but implemented as an extension for technical reasons.

  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  30. def withBase(base: ExtensionBundle): ExtensionBundle

    Returns a new extension bundle by merging the content of this bundle with the content of the base bundle.

    Returns a new extension bundle by merging the content of this bundle with the content of the base bundle.

    The other bundle is treated as the base of this bundle, which means that:

    - in case of optional features a feature defined in this bundle will overwrite a feature defined in the base

    - in case of features applied in sequence, the features in this bundle will be applied before the features in the base bundle

    - in case of feature collections, the features of this bundle will be merged with those of the base bundle

Inherited from AnyRef

Inherited from Any

Ungrouped