Package

laika

directive

Permalink

package directive

Visibility
  1. Public
  2. All

Type Members

  1. case class Attribute(id: PartId) extends Key with Product with Serializable

    Permalink
  2. case class Body(id: PartId) extends Key with Product with Serializable

    Permalink
  3. trait BuilderContext[E <: Element] extends AnyRef

    Permalink

    Provides the basic building blocks for Laika's Directive API.

    Provides the basic building blocks for Laika's Directive API. This trait is not used directly, but instead its three subtraits Blocks, Spans and Templates, which represent the concrete implementations for the three directive types.

  4. trait DirectiveRegistry extends ExtensionBundle

    Permalink

    Registry for custom directives.

    Registry for custom directives. Application code can define any number of instances mixing in this trait and then pass them to Parse, Render or Transform operations:

    object MyDirectives extends DirectiveRegistry {
      val spanDirectives = Seq(...)
      val blockDirectives = Seq(...)
      val templateDirectives = Seq(...)
    }
    object OtherDirectives extends DirectiveRegistry {
      [...]
    }
    
    Transform
      .from(Markdown)
      .to(HTML)
      .using(MyDirectives, OtherDirectives)
      .fromFile("hello.md")
      .toFile("hello.html")
  5. class DirectiveSupport extends ExtensionBundle

    Permalink

    Internal API that processes all directives defined by one or more DirectiveRegistries.

    Internal API that processes all directives defined by one or more DirectiveRegistries. This extension is installed by default, unless the transformation is run in strict mode.

  6. case class Failure(messages: Seq[String]) extends Result[Nothing] with Product with Serializable

    Permalink

    Represents the failed computation of a directive part.

    Represents the failed computation of a directive part. This failure type can be combined with other failures to "collect" all error messages, in contrast to the Either type for example, which always only carries one Left value through a chain of computations.

  7. sealed abstract class Key extends AnyRef

    Permalink
  8. sealed abstract class PartId extends AnyRef

    Permalink

    The id for a directive part.

  9. sealed abstract class Result[+A] extends AnyRef

    Permalink

    Represents the result (or combined results) of processing one or more parts of a directive.

  10. case class Success[+A](a: A) extends Result[A] with Product with Serializable

    Permalink

    Represents the successful computation of a directive part.

Value Members

  1. object Blocks extends BuilderContext[Block]

    Permalink

    The API for declaring directives that can be used as block elements in markup documents.

  2. object Builders

    Permalink

    Generic support for builders that allow to combine container types with matching type classes into a final result.

    Generic support for builders that allow to combine container types with matching type classes into a final result.

    The concrete use case for Laika is a concise and type-safe API for setting up directives or text roles. For these APIs and sample code see laika.directive.BuilderContext.dsl, laika.rst.ext.Directives and laika.rst.ext.TextRoles.

    This implementation is based on a concept outlined by Sadek Drobi in this gist: https://gist.github.com/sadache/3646092. The code used here is only a simplified subset of the demonstrated functionality.

  3. object DirectiveSupport extends DirectiveSupport

    Permalink

    Empty default instance without any directives installed.

  4. object Failure extends Serializable

    Permalink
  5. object PartId

    Permalink
  6. object Spans extends BuilderContext[Span]

    Permalink

    The API for declaring directives that can be used as inline elements in markup documents.

  7. object StandardDirectives extends DirectiveRegistry

    Permalink

    Provides the implementation for the standard directives included in Laika.

    Provides the implementation for the standard directives included in Laika.

    These include:

    • toc: Generates a table of content from a specified root node.
    • fragment: Marks a block in a markup document as being separate from the main content, so that it can be placed separately in templates.
    • for: Accesses a value from the context and sets it as the reference context for its body elements, executing the body if the referenced value is non-empty and executing it multiple times when it is a collection.
    • if: Accesses a value from the context and processes the body element only when it is a value recognized as true.
    • format: Process the body element only when the output format matches the format specified in the directive (e.g. pdf or html).
    • style: Adds a style property to the body element.
    • fragment: Adds the body as a fragment to the target document, separate from the main content, to be rendered in different locations of the output, like headers, footers or sidebars.
    • pageBreak: Inserts a page break element into the tree (will only be rendered by page-based output, like XSL-FO or PDF.
  8. object Templates extends BuilderContext[TemplateSpan]

    Permalink

    The API for declaring directives that can be used in templates.

Ungrouped