BaseFormatter

laika.render.BaseFormatter
abstract class BaseFormatter[Rep <: BaseFormatter[Rep]](renderChild: (Rep, Element) => String, currentElement: Element, parents: List[Element], indentation: Indentation, messageFilter: MessageFilter)

API basis for renderers that produce character output.

Value parameters

currentElement

the active element currently being rendered

indentation

the indentation mechanism for this formatter

messageFilter

the filter to apply before rendering runtime messages

parents

the stack of parent elements of this formatter in recursive rendering, with the root element being the last in the list

renderChild

the function to use for rendering child elements

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class TagFormatter[Rep]
class FOFormatter
Self type
Rep

Members list

Value members

Abstract methods

protected def withChild(element: Element): Rep
protected def withIndentation(newIndentation: Indentation): Rep

Concrete methods

def child(element: Element): String

Renders the specified element on the current line.

Renders the specified element on the current line.

Attributes

def childPerLine(elements: Seq[Element]): String

Renders the specified elements, each of them on a new line using the current level of indentation.

Renders the specified elements, each of them on a new line using the current level of indentation.

Attributes

def children(elements: Seq[Element]): String

Renders the specified elements, all on the same line, without any separators.

Renders the specified elements, all on the same line, without any separators.

Attributes

def forMessage(message: RuntimeMessage)(whenEnabled: String): String

Renders the specified string only when the given message has at least the minimum message level defined for this formatter instance.

Renders the specified string only when the given message has at least the minimum message level defined for this formatter instance.

Attributes

def indented(f: Rep => String): String

Invokes the specified render function with a new formatter that is indented one level to the right of this formatter.

Invokes the specified render function with a new formatter that is indented one level to the right of this formatter.

Attributes

def indentedChildren(elements: Seq[Element]): String

Renders the specified elements, each of them on a new line with the indentation increased one level to the right.

Renders the specified elements, each of them on a new line with the indentation increased one level to the right.

Attributes

def withMinIndentation(minIndent: Int)(f: Rep => String): String

Invokes the specified render function with a formatter that has at least the specified minimum level of indentation. If this instance already has an indentation equal or greater to this value, the current level of indentation will be kept.

Invokes the specified render function with a formatter that has at least the specified minimum level of indentation. If this instance already has an indentation equal or greater to this value, the current level of indentation will be kept.

Attributes

def withoutIndentation(f: Rep => String): String

Invokes the specified render function with a new formatter that has all indentation disabled.

Invokes the specified render function with a new formatter that has all indentation disabled.

This is usually only required when rendering literal elements or source code where rendered whitespace would be significant.

Attributes

Concrete fields

val newLine: String

A newline character followed by whitespace matching the indentation level of this instance.

A newline character followed by whitespace matching the indentation level of this instance.

Attributes