o

laika.directive.std

StandardDirectives

object StandardDirectives extends DirectiveRegistry

Provides the implementation for the standard directives included in Laika.

These include:

Navigation

- navigationTree: Generates a navigation tree either automatically from specified root nodes of the input tree or by specifying entries manually (or a combination of both). - breadcrumb: Builds a navigation list from the root node of the input tree to the current document. - api: Convenience directive that allows to reference an api documentation entry (e.g. scaladoc, javadoc) - source: Convenience directive that allows to reference a hosted source (e.g. on GitHub)

Inclusions

- include: Includes one template or markup document inside another, with the options to pass attributes that can be referenced in the included document. - embed: All the features of include, but also allows to pass a parsed directive body that can be referenced in the included document.

Applying Styles

- style: Adds one or more style properties to the body element (markup block or span).

Markup Blocks

- image: Alternative to native markup syntax for including images that supports additional attributes, like intrinsicWidth and intrinsicHeight to avoid layout shift, as well as alt and title. - callout: A decorated block element that stands out from the surrounding paragraphs; the default Helium theme renders the content with background color and icon. - select: Allows to create alternative versions of the same documentation, for example one with Scala code examples and one with Java. - fragment: Marks a block in a markup document as being separate from the main content, so that it can be placed independently in templates, e.g. in headers, footers or sidebars. - format: Process the body element only when the output format matches the format specified in the directive (e.g. pdf or html).

HTML Templates

- linkCSS: Adds link elements to HTML/EPUB output for all or selected CSS files found in the document tree - linkJS: Adds link elements to HTML/EPUB output for all or selected JavaScript files found in the document tree - target: Translates a link target. External targets will be rendered verbatim, internal targets (absolute or relative paths) will be resolved from the perspective of a template to a path relative to the document the template had been applied to. - path: Deprecated, use the newer target directive instead which is a superset of its functionality - date: renders a date with a specified formatting pattern - attribute: renders an HTML attribute if the specified config value is defined

Conditionals and Loops

- 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.

PDF Output

- pageBreak: Inserts a page break element into the tree (will only be rendered by page-based output, like XSL-FO or PDF.

Comments

- todo: simple directive that accepts a string argument that will be ignored by renderers, overcoming the limitation that Markdown does not have a native comment syntax.

For extensive documentation see Standard Directives in the manual.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StandardDirectives
  2. DirectiveRegistry
  3. ExtensionBundle
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. lazy val attr: Templates.Directive
  6. def baseConfig: Config

    Base configuration that serves as a fallback for configuration files in the source directories and/or config headers in markup and template documents.

    Base configuration that serves as a fallback for configuration files in the source directories and/or config headers in markup and template documents.

    Definition Classes
    ExtensionBundle
  7. lazy val blockDirectives: Seq[Blocks.Directive]

    The complete list of standard directives for block elements in markup documents.

    The complete list of standard directives for block elements in markup documents.

    Definition Classes
    StandardDirectivesDirectiveRegistry
  8. lazy val blockFragment: Blocks.Directive

    Implementation of the fragment directive for block elements in markup documents.

  9. lazy val blockStyle: Blocks.Directive

    Implementation of the style directive for block elements in markup documents.

  10. lazy val callout: Blocks.Directive

    Implementation of the callout directive for block elements in markup documents.

    Implementation of the callout directive for block elements in markup documents. The body of such a directive will get two styles assigned: callout and the argument passed to the directive (e.g. @:callout(info)).

  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  12. lazy val date: Templates.Directive
  13. val description: String

    Short string describing the extension for tooling and logging.

    Short string describing the extension for tooling and logging.

    Definition Classes
    StandardDirectivesDirectiveRegistryExtensionBundle
  14. def docTypeMatcher: PartialFunction[Path, DocumentType]

    Specifies the function to use for determining the document type of the input based on its path.

    Specifies the function to use for determining the document type of the input based on its path.

    Any path for which this function is not defined will be processed by the remaining defined bundles. The documents for paths for which none of the extensions provides a DocumentType will be treated as static files to be copied over to the target directory in transformations by default.

    Definition Classes
    ExtensionBundle
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. def extendPathTranslator: PartialFunction[PathTranslatorExtensionContext, PathTranslator]

    Extends the built-in path translator with additional functionality.

    Extends the built-in path translator with additional functionality.

    The internal path translator deals with aspects like applying the suffix for the output format or modifying the path for versioned documents and more.

    The PathTranslatorExtensionContext provides access to this internal path translator, to the output format it is going to be used for and the complete user configuration.

    In most cases, extensions can simply be created by using either PathTranslator.preTranslate or PathTranslator.postTranslate to apply additional translation steps either before or after applying the internal translator.

    Alternatively a completely custom implementation of the PathTranslator trait can be provided, but this will usually not be necessary.

    PathTranslator implementations usually do not deal with the fragment part of the path. Use the slugBuilder extension point for this purpose.

    Definition Classes
    ExtensionBundle
  18. def forStrictMode: Option[ExtensionBundle]

    Provides a version of this bundle that can be used in strict mode or None if the entire bundle should be removed in strict mode.

    Provides a version of this bundle that can be used in strict mode or None if the entire bundle should be removed in strict mode.

    When strict mode does not affect a bundle it can return Some(this).

    Any bundle to be used in strict mode should be free from any parser extensions that adds features to markup syntax beyond their respective specifications.

    Definition Classes
    DirectiveRegistryExtensionBundle
  19. lazy val format: Blocks.Directive

    Implementation of the format directive for block elements in markup documents.

    Implementation of the format directive for block elements in markup documents. The content of such a block will only be rendered for the corresponding output format (e.g. pdf or html).

  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. lazy val iconSpan: Spans.Directive

    Implementation of the icon directive for span elements in markup documents.

  23. lazy val iconTemplate: Templates.Directive

    Implementation of the icon directive for span elements in templates.

  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. lazy val linkDirectives: Seq[Directive]

    The complete list of standard directives for links.

    The complete list of standard directives for links.

    Definition Classes
    StandardDirectivesDirectiveRegistry
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  29. val origin: BundleOrigin

    Indicates whether the bundle is a built-in default provided by the library, a collection of extensions installed by a markup format or user-defined.

    Indicates whether the bundle is a built-in default provided by the library, a collection of extensions installed by a markup format or user-defined.

    This is relevant for determining the precedence of installed bundles when merging them, as user-supplied functionality always overrides library defaults.

    Definition Classes
    StandardDirectivesExtensionBundle
  30. lazy val pageBreak: Blocks.Directive

    Implementation of the pageBreak directive.

  31. def parsers: ParserBundle

    Specifies extensions and/or replacements for parsers that deal with text markup, templates, CSS or configuration headers.

    Specifies extensions and/or replacements for parsers that deal with text markup, templates, CSS or configuration headers.

    Definition Classes
    ExtensionBundle
  32. def processExtension: PartialFunction[ExtensionBundle, ExtensionBundle]

    Internal API usually only called by other extension bundles.

    Internal API usually only called by other extension bundles.

    In some cases a bundle might be an extension of another bundle and needs the opportunity to process and modify that bundle without requiring a direct reference to it. An example is a registry for directives which needs to pass all its registered directives to the bundle which deals with finally creating all the directive parsers.

    The partial function should match only on the types of bundles it intends to process and is then allowed to return a new, modified instance of that bundle.

    Definition Classes
    DirectiveRegistryExtensionBundle
  33. def rawContentDisabled: Option[ExtensionBundle]

    Provides a version of this bundle that can be used in the default run mode where raw content in markup documents (such as embedded HTML) is disabled.

    Provides a version of this bundle that can be used in the default run mode where raw content in markup documents (such as embedded HTML) is disabled.

    When a bundle does not add parsers for raw content it can return Some(this).

    Any bundle to be used in the default run mode should be free from any parser extensions that allow raw content in markup. When the user switches the acceptRawContent flag to true then this method will not be invoked and the initial instance of the bundle is used.

    Definition Classes
    ExtensionBundle
  34. def renderOverrides: Seq[RenderOverrides]

    The overrides for renderers defined by this bundle.

    The overrides for renderers defined by this bundle.

    An override is always specific to a particular output format like HTML or PDF. A bundle can contain multiple overrides for the same output format which will be merged before use.

    Definition Classes
    ExtensionBundle
  35. def rewriteRules: RewritePhaseBuilder

    Specifies rewrite rules to be applied to the document tree model between the parse and render operations.

    Specifies rewrite rules to be applied to the document tree model between the parse and render operations.

    The specified functions will be invoked for each document, allowing to capture information from the entire document tree before returning the actual rule, which is a partial function from Element to Option[Element] that allows to remove or replace elements from the tree.

    Definition Classes
    ExtensionBundle
  36. def slugBuilder: Option[(String) ⇒ String]

    Function that receives the text of a headline, the name of a document or directory or a manually assigned identifier, and builds a slug from it that becomes part of the final URL or identifier (depending on output format).

    Function that receives the text of a headline, the name of a document or directory or a manually assigned identifier, and builds a slug from it that becomes part of the final URL or identifier (depending on output format).

    The result of the function must be:

    - a valid identifier in HTML and XML - a valid path segment in a URL - a valid file name

    Definition Classes
    ExtensionBundle
  37. lazy val spanDirectives: Seq[Spans.Directive]

    The complete list of standard directives for span elements in markup documents.

    The complete list of standard directives for span elements in markup documents.

    Definition Classes
    StandardDirectivesDirectiveRegistry
  38. lazy val spanStyle: Spans.Directive

    Implementation of the style directive for span elements in markup documents.

  39. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  40. lazy val target: Templates.Directive
  41. lazy val templateDirectives: Seq[Templates.Directive]

    The complete list of standard directives for templates.

    The complete list of standard directives for templates.

    Definition Classes
    StandardDirectivesDirectiveRegistry
    Annotations
    @nowarn()
  42. lazy val templateFragment: Templates.Directive

    Implementation of the fragment directive for templates.

  43. def toString(): String
    Definition Classes
    AnyRef → Any
  44. val todoBlock: Blocks.Directive

    Implementation of the todo directive for block elements.

  45. val todoSpan: Spans.Directive

    Implementation of the todo directive for inline elements.

  46. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. def withBase(base: ExtensionBundle): ExtensionBundle

    Returns a new extension bundle by merging the content of this bundle with the content of the base bundle.

    Returns a new extension bundle by merging the content of this bundle with the content of the base bundle.

    The other bundle is treated as the base of this bundle, which means that:

    - in case of optional features a feature defined in this bundle will overwrite a feature defined in the base

    - in case of features applied in sequence, the features in this bundle will be applied before the features in the base bundle

    - in case of feature collections, the features of this bundle will be merged with those of the base bundle

    Definition Classes
    ExtensionBundle

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated
  2. lazy val path: Templates.Directive
    Annotations
    @deprecated
    Deprecated

    (Since version 0.19.0) use target directive instead

Inherited from DirectiveRegistry

Inherited from ExtensionBundle

Inherited from AnyRef

Inherited from Any

Ungrouped