laika.format

package laika.format

Members list

Type members

Classlikes

case object AST extends RenderFormat[Formatter]

A renderer for AST output (a formatted Abstract Syntax Tree), primarily useful for debugging purposes.

A renderer for AST output (a formatted Abstract Syntax Tree), primarily useful for debugging purposes. May be directly passed to the Render or Transform APIs:

Renderer.of(AST).build.render(document)

Transformer.from(Markdown).to(AST).build.transform(inputString)

Attributes

Source
AST.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
AST.type

A post processor for EPUB output, based on an interim HTML renderer.

A post processor for EPUB output, based on an interim HTML renderer. May be directly passed to the Renderer or Transformer APIs:

val transformer = Transformer
 .from(Markdown)
 .to(EPUB)
 .using(GitHubFlavor)
 .parallel[IO]
 .build

val res: IO[Unit] = transformer
 .fromDirectory("src")
 .toFile("demo.epub")
 .transform

In the example above the input from an entire directory gets merged into a single output file.

Attributes

Source
EPUB.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
EPUB.type
case object HTML extends RenderFormat[TagFormatter]

A render format for HTML output.

A render format for HTML output. May be directly passed to the Render or Transform APIs:

Renderer.of(HTML).build.render(document)

Transformer.from(Markdown).to(HTML).build.transform(inputString)

Attributes

Source
HTML.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
HTML.type
case object Markdown extends MarkupFormat

A parser for Markdown text.

A parser for Markdown text. Instances of this class may be passed directly to the Parser or Transformer APIs:

val document = MarkupParser.of(Markdown).build.parse(inputString)

Transformer.from(Markdown).to(HTML).build.transform(inputString)

Since this library is not solely focused on producing HTML output, parsing verbatim HTML elements like defined by the official Markdown syntax description is an optional feature, as some types of renderers would not know what to do with HTML nodes in the document tree. It must be enabled explicitly:

val parser = MarkupParser.of(Markdown).withRawContent.build

To switch off all custom extensions like directives, configuration sections at the start of the document or automatic id generation for headers, you can run the parser in strict mode:

val transformer = Transformer.from(Markdown).to(HTML).strict

Attributes

Source
Markdown.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait MarkupFormat
class Object
trait Matchable
class Any
Show all
Self type
Markdown.type

A post processor for PDF output, based on an interim XSL-FO renderer.

A post processor for PDF output, based on an interim XSL-FO renderer. May be directly passed to the Render or Transform APIs:

val transformer = Transformer
 .from(Markdown)
 .to(PDF)
 .using(GitHubFlavor)
 .parallel[IO]
 .build

val res: IO[Unit] = transformer
 .fromDirectory("src")
 .toFile("demo.pdf")
 .transform

In the example above the input from an entire directory gets merged into a single output file.

Attributes

Source
PDF.scala
Supertypes
class Object
trait Matchable
class Any
Self type
PDF.type
case object ReStructuredText extends MarkupFormat

A parser for text written in reStructuredText markup.

A parser for text written in reStructuredText markup. Instances of this class may be passed directly to the Parseer or Transformer APIs:

val document = MarkupParser.of(ReStructuredText).build.parse(inputString)

Transformer.from(ReStructuredText).to(HTML).build.transform(inputString)

In addition to the implementing the standard reStructuredText directives, the Laika APIs also supports a custom directive type unique to Laika. They represent a library-wide extension mechanism and allow you to implement tags which can be used in any of the supported markup formats or in templates.

Laika directives can be registered with the laika.api.bundle.DirectiveRegistry extension bundle.

Attributes

Source
ReStructuredText.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait MarkupFormat
class Object
trait Matchable
class Any
Show all
Self type
object XSLFO extends RenderFormat[TagFormatter]

A renderer for XSL-FO output.

A renderer for XSL-FO output. May be directly passed to the Render or Transform APIs:

Renderer.of(XSLFO).build.render(document)

Transformer.from(Markdown).to(XSLFO).build.transform(inputString)

This renderer is usually used as an interim format for producing a PDF, where you do not deal with this format directly. But it can alternatively also be used as the final output and then get processed by external tools.

Attributes

Source
XSLFO.scala
Supertypes
class Object
trait Matchable
class Any
Self type
XSLFO.type