laika.parse.markup

Members list

Type members

Classlikes

trait BlockParsers

Provides base parsers that abstract aspects of block parsing common to most lightweight markup languages.

Provides base parsers that abstract aspects of block parsing common to most lightweight markup languages.

A block parser in Laika can always safely assume that it is invoked at the start of the current line and that the line is not empty.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object BlockParsers.type
object builders.type
object BlockParsers extends BlockParsers

Instance that allows to import all block parsers in isolation.

Instance that allows to import all block parsers in isolation.

Usually it is more convenient to import laika.parse.api._ to get all parser builders with one import.

Attributes

Companion
trait
Supertypes
trait BlockParsers
class Object
trait Matchable
class Any
Self type

Default implementation for parsing escape sequences.

Default implementation for parsing escape sequences.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Default implementation for parsing inline markup and blocks recursively.

Default implementation for parsing inline markup and blocks recursively.

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
Known subtypes
class RootParser

Default implementation for parsing inline markup recursively.

Default implementation for parsing inline markup recursively.

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
Known subtypes

Responsible for creating the top level parsers for text markup and template documents, by combining the parser for the root element with a parser for an (optional) configuration header.

Responsible for creating the top level parsers for text markup and template documents, by combining the parser for the root element with a parser for an (optional) configuration header.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class EndDelimiter(capturedText: String) extends InlineResult

The result in case the end delimiter for the text has been parsed.

The result in case the end delimiter for the text has been parsed.

Attributes

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

Provides parsers for escaped text, custom span parser implementations can use these without knowing the rules of the host markup language for escaping text.

Provides parsers for escaped text, custom span parser implementations can use these without knowing the rules of the host markup language for escaping text.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class InlineDelimiter(nestedDelimiters: Set[Char], endDelimiters: Delimiter[String])

Delimiter implementation for parsing inline spans that distinguishes between a delimiter that marks the end of the span and a delimiter that marks the start of a nested span.

Delimiter implementation for parsing inline spans that distinguishes between a delimiter that marks the end of the span and a delimiter that marks the start of a nested span.

Attributes

Supertypes
class Object
trait Matchable
class Any
trait InlineParser[Elem, To] extends Parser[To]

Generic base parser that parses inline elements with potentially nested spans.

Generic base parser that parses inline elements with potentially nested spans.

The two embed methods allow the registration of parsers for nested child spans. They can be invoked multiple times. Child parsers passed first have higher precedence than those passed later.

Only parsers of type PrefixedParser[T] can be passed to the embed methods, which are parsers with known, stable prefixes of the child span consisting of a limited set of characters so that the checks that need to be performed for each character can be optimized for performance.

Type parameters

Elem

the element type produced by a single parser for a nested span

To

the type of the result this parser produces

Attributes

Supertypes
class Parser[To]
class Object
trait Matchable
class Any

Provides base parsers that abstract aspects of inline parsing common to most lightweight markup languages.

Provides base parsers that abstract aspects of inline parsing common to most lightweight markup languages.

It contains helper parsers that abstract the typical logic required for parsing nested spans. In many cases a parser has to recognize the end of the span as well as potentially the start of a nested span. These two concerns are usually unrelated.

This object offers helpers that simplify creating these types of parsers and also optimize performance of inline parsing. Due to the nature of lightweight text markup inline parsing would usually require trying a long list of choices on each input character, which is slow. These base parsers work based on mappings from the first character of an inline span to the corresponding full parser.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object InlineParsers.type
object builders.type
object InlineParsers extends InlineParsers

Instance that allows to import all inline parsers in isolation.

Instance that allows to import all inline parsers in isolation.

Usually it is more convenient to import laika.parse.api._ to get all parser builders with one import.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait InlineResult

The result of text parsed with an InlineDelimiter.

The result of text parsed with an InlineDelimiter.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class NestedDelimiter(startChar: Char, capturedText: String) extends InlineResult

The result in case the start character of a nested span has been parsed.

The result in case the start character of a nested span has been parsed.

Attributes

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

Parses a sequence of blocks based on the available block types of the host markup language.

Parses a sequence of blocks based on the available block types of the host markup language.

This parser always parses to the end of the input, therefore it is usually applied to the result of a previous parser invocation.

The API is restricted and not the standard Parser API to prevent invocations with just a plain string which would lose all position tracking in error messages. Instead both methods expect a full SourceFragment instance which carries the context of the root input.

Attributes

Supertypes
class Object
trait Matchable
class Any

Provides parsers for nested blocks, custom block parser implementations can use these without knowing the available span or block types of the host markup language.

Provides parsers for nested blocks, custom block parser implementations can use these without knowing the available span or block types of the host markup language.

Includes the support for nested spans and escaped text.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Parses a sequence of spans based on the available spans types of the host markup language.

Parses a sequence of spans based on the available spans types of the host markup language.

This parser always parses to the end of the input, therefore it is usually applied to the result of a previous parser invocation.

The API is restricted and not the standard Parser API to prevent invocations with just a plain string which would lose all position tracking in error messages. Instead both methods expect a full SourceFragment instance which carries the context of the root input.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Provides parsers for nested spans, custom span parser implementations can use these without knowing the available span types of the host markup language.

Provides parsers for nested spans, custom span parser implementations can use these without knowing the available span types of the host markup language.

Includes the support for escaped text.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class RootParser(markupParser: MarkupFormat, markupExtensions: MarkupExtensions) extends DefaultRecursiveParsers

Responsible of assembling all the block, inline, text and configuration parsers supported by a text markup language.

Responsible of assembling all the block, inline, text and configuration parsers supported by a text markup language.

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all