DirectiveParsers

laika.parse.directive.DirectiveParsers$

Parsers for all types of custom directives that can be used in templates or as inline or block elements in markup documents.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class DirectiveSpec(name: String, fence: String)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ParsedDirective(name: String, attributes: ObjectBuilderValue, body: Option[SourceFragment])

Represents the parsed but unprocessed content of a directive.

Represents the parsed but unprocessed content of a directive.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Part(key: AttributeKey, content: String)

Represents one part of a directive (an attribute or a body element).

Represents one part of a directive (an attribute or a body element).

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def declarationParser(escapedText: EscapedTextParsers, supportsCustomFence: Boolean): Parser[(String, ObjectBuilderValue, String)]

Parses a full directive declaration, containing all its attributes, but not the body elements.

Parses a full directive declaration, containing all its attributes, but not the body elements.

Attributes

def directiveParser(bodyContent: BodyParserBuilder, escapedText: EscapedTextParsers, supportsCustomFence: Boolean): Parser[ParsedDirective]

Parses one directive instance containing its name declaration, all attributes and all body elements.

Parses one directive instance containing its name declaration, all attributes and all body elements.

Value parameters

bodyContent

the parser for the body content which is different for a block directive than for a span or template directive

escapedText

the parser for escape sequences according to the rules of the host markup language

supportsCustomFence

indicates whether the directive declaration allows the addition of a custom closing fence

Attributes

def hoconReference[T](f: (Key, Boolean, SourceFragment) => T, e: InvalidSpan => T): PrefixedParser[T]

Parses a HOCON-style reference enclosed between ${ and } that may be marked as optional (${?some.param}).

Parses a HOCON-style reference enclosed between ${ and } that may be marked as optional (${?some.param}).

Attributes

Concrete fields

lazy val nameDecl: Parser[String]

Parses a name declaration that start with a letter and continues with letters, numbers or the symbols '-' or '_'.

Parses a name declaration that start with a letter and continues with letters, numbers or the symbols '-' or '_'.

Attributes

lazy val wsOrNl: Parser[String]

Parses horizontal whitespace or newline characters.

Parses horizontal whitespace or newline characters.

Attributes