SyntaxHighlighting

laika.config.SyntaxHighlighting
case object SyntaxHighlighting extends ExtensionBundle

Extension that registers all code syntax highlighters provided out of the box.

The extension can be added to a transformer like any other extension:

val transformer = Transformer
 .from(Markdown)
 .to(HTML)
 .using(GitHubFlavor)
 .using(SyntaxHighlighting)
 .build

Attributes

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

Members list

Type members

Inherited types

type MirroredElemLabels = EmptyTuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Singleton
Source
Mirror.scala
type MirroredElemTypes = EmptyTuple

Attributes

Inherited from:
Singleton
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredMonoType = Singleton.this.type

The mirrored *-type

The mirrored *-type

Attributes

Inherited from:
Singleton
Source
Mirror.scala
type MirroredType = Singleton.this.type

Attributes

Inherited from:
Singleton
Source
Mirror.scala

Value members

Concrete methods

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

Attributes

Definition Classes
Source
SyntaxHighlighting.scala

Creates a new extension bundle that contains the built-in syntax highlighters as well as the specified list of custom highlighters.

Creates a new extension bundle that contains the built-in syntax highlighters as well as the specified list of custom highlighters.

Attributes

Source
SyntaxHighlighting.scala

Creates a new extension bundle that contains the built-in syntax highlighters as well as the specified highlighter, binding it to the given language string instead of those declared in the instance itself.

Creates a new extension bundle that contains the built-in syntax highlighters as well as the specified highlighter, binding it to the given language string instead of those declared in the instance itself. Can be used to create an alias for an existing syntax, e.g. binding dotty to scala instead.

Attributes

Source
SyntaxHighlighting.scala

Inherited methods

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.

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala

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.

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala

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.

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala

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.

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala
def fromProduct(p: Product): MirroredMonoType

Create a new instance of type T with elements taken from product p.

Create a new instance of type T with elements taken from product p.

Attributes

Inherited from:
Singleton
Source
Mirror.scala

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.

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

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.

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala

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.

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala

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.

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala

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

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala

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

Attributes

Inherited from:
ExtensionBundle
Source
ExtensionBundle.scala

Concrete fields

Short string describing the extension for tooling and logging.

Short string describing the extension for tooling and logging.

Attributes

Source
SyntaxHighlighting.scala
override 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.

Attributes

Source
SyntaxHighlighting.scala