Renderer

laika.api.Renderer
See theRenderer companion object
abstract class Renderer(val config: OperationConfig, skipRewrite: Boolean)

Performs a render operation from a document AST to a target format as a string. The document AST may be obtained by a preceding parse operation or constructed programmatically.

In cases where a parse operation should precede immediately, it is more convenient to use a laika.api.Transformer instead which combines a parse and a render operation directly.

Example for rendering HTML:

val doc: Document = ???

val res: String = Renderer
  .of(HTML)
  .build
  .render(doc)

This is a pure API that does not perform any side-effects. For additional options like File and Stream I/O, templating or parallel processing, use the corresponding builders in the laika-io module.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Types

type Formatter

Value members

Abstract methods

Concrete methods

def forInputFormat(markupFormat: MarkupFormat): Renderer
def render(doc: Document): Either[RendererError, String]

Renders the specified document as a String.

Renders the specified document as a String.

Attributes

def render(doc: Document, pathTranslator: PathTranslator, styles: StyleDeclarationSet): Either[RendererError, String]

Renders the specified document as a String, using the given path translator and styles.

Renders the specified document as a String, using the given path translator and styles.

Currently only PDF/XSL-FO output processes styles, all other formats will ignore them.

Attributes

def render(element: Element): Either[RendererError, String]

Renders the specified element as a String.

Renders the specified element as a String.

Attributes

def render(element: Element, path: Path): Either[RendererError, String]

Renders the specified element as a String.

Renders the specified element as a String.

The provided (virtual) path may be used by renderers for cross-linking between documents.

Attributes

def render(element: Element, path: Path, pathTranslator: PathTranslator, styles: StyleDeclarationSet): Either[RendererError, String]

Renders the specified element as a String, using the given path translator and styles.

Renders the specified element as a String, using the given path translator and styles.

Currently only PDF/XSL-FO output processes styles, all other formats will ignore them.

The provided (virtual) path may be used by renderers for cross-linking between documents.

Attributes

Creates a new instance that will skip the rewrite phase when rendering elements.

Creates a new instance that will skip the rewrite phase when rendering elements.

Useful when rewriting has already been performed by a processing step external to the the library's core APIs.

Attributes

Concrete fields