Package

laika

format

Permalink

package format

Visibility
  1. Public
  2. All

Value Members

  1. object AST extends RenderFormat[TextWriter]

    Permalink

    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:

    Render as AST from document toString
    
    Transform from Markdown to AST fromFile "hello.md" toConsole
  2. object HTML extends RenderFormat[HTMLWriter]

    Permalink

    A render format for HTML output.

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

    Render as HTML from document toFile "hello.html"
    
    Transform from Markdown to HTML fromFile "hello.md" toFile "hello.html"
  3. object Markdown extends MarkupParser

    Permalink

    A parser for Markdown text.

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

    val document = Parse as Markdown fromFile "hello.md"
    
    Transform from Markdown to HTML fromFile "hello.md" toFile "hello.html"

    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 document = Parse.as(Markdown).withRawContent.fromFile("hello.md")

    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:

    Transform.from(Markdown).to(HTML).strict
      .fromFile("hello.md").toFile("hello.html")
  4. object ReStructuredText extends MarkupParser

    Permalink

    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 Parse or Transform APIs:

    val document = Parse as ReStructuredText fromFile "hello.rst"
    
    Transform from ReStructuredText to HTML fromFile "hello.rst" toFile "hello.html"

    reStructuredText has several types of extension points that are fully supported by Laika. For more information on how to implement and register those see laika.rst.bundle.RstExtensionRegistry.

    In addition to the standard reStructuredText directives, the API 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. If you need this level of flexibility, it is recommended to use the Laika directives, if you want to stay compatible with the reStructuredText reference parser, you should pick the standard directives.

    Laika directives can be registered with the laika.directive.DirectiveRegistry extension bundle. The DSLs for creating directives are similar, but still different, due to differences in the feature set of the two variants. The Laika directives try to avoid some of the unnecessary complexities of reStructuredText directives.

  5. object XSLFO extends RenderFormat[FOWriter]

    Permalink

    A renderer for XSL-FO output.

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

    Render as XSLFO from document toFile "hello.fo"
    
    Transform from Markdown to XSLFO fromFile "hello.md" toFile "hello.fo"

    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.

Ungrouped