Packages

class ThemeBuilder[F[_]] extends AnyRef

Builder API for constructing Theme instances, providing several shortcuts for defining the contents of a theme. A theme can consist of inputs like templates, CSS or JavaScript files and optionally of one or more extension bundles for customizing Laika with features like directives or parser extensions.

The API is entirely optional and can be used to avoid boilerplate when implementing a laika.theme.ThemeProvider.

Self Type
ThemeBuilder[F]
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ThemeBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 addBaseConfig(config: Config): ThemeBuilder[F]

    Add pre-populated configuration to the theme that will be merged with the user-supplied configuration.

    Add pre-populated configuration to the theme that will be merged with the user-supplied configuration. User configuration has always higher precedence than theme configuration. It is recommended to put all theme-specific configuration into a namespace to avoid clashes.

    Most common use case for pre-populating configuration is to provide AST nodes and strings to be used in the theme templates.

  5. def addExtensions(bundles: ExtensionBundle*): ThemeBuilder[F]

    Adds one or more extension bundles to the theme.

    Adds one or more extension bundles to the theme. For the most common bundle features like pre-populated configuration, rewrite rules or render overrides, the respective shortcuts of this class can be used to avoid the boilerplate of extending ExtensionBundle yourself. The shortcuts are addBaseConfig, addRewriteRules and addRenderOverrides.

  6. def addInputs(inputBuilders: F[InputTreeBuilder[F]]): ThemeBuilder[F]

    Adds the specified inputs, suspended in the effect F, to the theme.

    Adds the specified inputs, suspended in the effect F, to the theme. When the method is invoked multiple times the respective input trees will be merged.

  7. def addInputs(inputs: InputTreeBuilder[F]): ThemeBuilder[F]

    Adds the specified inputs to the theme.

    Adds the specified inputs to the theme. When the method is invoked multiple times the respective input trees will be merged.

  8. def addRenderOverrides(overrides: RenderOverrides): ThemeBuilder[F]

    Adds overrides for the renderer which can be used for theme-specific UI elements.

    Adds overrides for the renderer which can be used for theme-specific UI elements. One example is to provide custom icons for some of Laika's decorated blocks, like those produced by the @:callout directive.

  9. def addRewriteRules(rules: RewriteRules): ThemeBuilder[F]

    Adds a custom rewrite rule that can swap or remove individual nodes from the document AST.

    Adds a custom rewrite rule that can swap or remove individual nodes from the document AST. In contrast to the processTree hook which looks at the entire tree of documents, a rewrite rule looks at the individual AST nodes within a document.

  10. def addRewriteRules(rules: RewriteRulesBuilder): ThemeBuilder[F]

    Adds a custom rewrite rule that can swap or remove individual nodes from the document AST.

    Adds a custom rewrite rule that can swap or remove individual nodes from the document AST. In contrast to the processTree hook which looks at the entire tree of documents, a rewrite rule looks at the individual AST nodes within a document.

    This is an overload that allows to construct the rules based on looking at the corresponding DocumentCursor first.

  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def build: Resource[F, Theme[F]]

    Builds a theme resource based on the elements passed to this builder instance.

  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. def processTree(f: TreeProcessor[F], format: Format): ThemeBuilder[F]

    Adds a function that processes the document tree between parsing and rendering, to be executed only for the specified output format.

    Adds a function that processes the document tree between parsing and rendering, to be executed only for the specified output format.

    In contrast to the addRewriteRule hook which looks at AST nodes within a document, this function can look at the entire tree and add, swap or remove documents for example.

    In case of binary formats like EPUB or PDF this processing step happens before the renderer for the interim format is invoked. As a consequence you need to pass their interim formats to this method, which is EPUB.XHTML for EPUB and XSLFO for PDF. This also avoids a dependency on the PDF module as the user of your theme might not use it.

    The laika.theme.TreeProcessorBuilder provides several shortcuts for constructing a TreeProcessor (which is just a type alias for a plain Kleisli).

  23. def processTree(f: (Format) ⇒ TreeProcessor[F]): ThemeBuilder[F]

    Adds a function that processes the document tree between parsing and rendering.

    Adds a function that processes the document tree between parsing and rendering. In contrast to the addRewriteRule hook which looks at AST nodes within a document, this function can look at the entire tree and add, swap or remove documents for example.

    The laika.theme.TreeProcessorBuilder provides several shortcuts for constructing a TreeProcessor (which is just a type alias for a plain Kleisli).

  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped