RendererBuilder

laika.api.builder.RendererBuilder
class RendererBuilder[FMT]

Builder API for Renderer instances.

Allows to add ExtensionBundles, to override the renderer for specific elements and other options.

Type parameters

FMT

the formatter API to use which varies depending on the renderer

Attributes

Source
RendererBuilder.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Types

The type of the operation being configured by this instance.

The type of the operation being configured by this instance.

Attributes

Source
RendererBuilder.scala

Value members

Concrete methods

Applies all configuration specified with this builder and returns a new Renderer instance.

Applies all configuration specified with this builder and returns a new Renderer instance.

Attributes

Source
RendererBuilder.scala

Returns a new instance with the specified configuration.

Returns a new instance with the specified configuration.

This method discards any previously specified options. It is usually meant to be used when copying over the configuration from a fully configured object to an unconfigured one.

Attributes

Source
RendererBuilder.scala

Inherited methods

def rendering(customRenderer: PartialFunction[(FMT, Element), String]): ThisType

Specifies a custom render function that overrides one or more of the default renderers for the output format this instance uses.

Specifies a custom render function that overrides one or more of the default renderers for the output format this instance uses.

This method expects a partial function that takes a formatter and the element to render. It will then be invoked for each element it is defined at.

Simple example for customizing the HTML output for emphasized text, adding a specific style class:

val transformer = Transformer.from(Markdown).to(HTML).rendering {
  case (fmt, Emphasized(content, opt)) => fmt.element("em", opt, content, "class" -> "big")
}.build

Attributes

Inherited from:
RendererBuilderOps (hidden)
Source
RendererBuilderOps.scala
def using(bundles: ExtensionBundle*): ThisType

Returns a new instance with the specified extension bundles installed.

Returns a new instance with the specified extension bundles installed. Features in the new bundles may override features in already installed bundles.

Bundles are usually provided by libraries (by Laika itself or a 3rd-party extension library) or as re-usable building blocks by application code.

Attributes

Inherited from:
CommonBuilderOps (hidden)
Source
CommonBuilderOps.scala
def withCompactRendering: ThisType

Renders without any formatting (line breaks or indentation).

Renders without any formatting (line breaks or indentation). Useful when storing the output in a database for example.

Attributes

Inherited from:
RendererBuilderOps (hidden)
Source
RendererBuilderOps.scala
def withMessageFilters(filters: MessageFilters): ThisType

Specifies the message filters to apply to the operation.

Specifies the message filters to apply to the operation.

By default operations fail on errors and do not render any messages (e.g. warnings) embedded in the AST. For visual debugging MessageFilters.forVisualDebugging can be used instead, where the transformation will always succeed (unless an error occurs that cannot be recovered from), and messages in the AST with level Info or higher will be rendered in the position they occurred.

Attributes

Inherited from:
RendererBuilderOps (hidden)
Source
RendererBuilderOps.scala

Concrete fields

The current configuration for this instance.

The current configuration for this instance.

Attributes

Source
RendererBuilder.scala

Attributes

Source
RendererBuilder.scala