StandardDirectiveParsers

laika.rst.std.StandardDirectiveParsers$

Defines the custom argument and body parsers for the standard directives. Most of these delegate to the default block or inline parsers for reStructuredText, but often do only except one specific block type like Table or QuotedBlock whereas the default block parser usually accepts any of the blocks.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def captionAndLegend(p: RecursiveParsers)(input: SourceFragment): Either[String, (Seq[Span], Seq[Block])]

Parses a caption (a single paragraph) and a legend (one or more blocks), both being optional.

Parses a caption (a single paragraph) and a legend (one or more blocks), both being optional.

Value parameters

input

the input to parse

p

the standard block parsers including all registered directives for recursive use

Attributes

Returns

Right in case of parser success and Left in case of failure, to adjust to the Directive API

def parseDirectivePart[T](parser: Parser[T], source: SourceFragment): Either[String, T]

Utility method to be used by custom parsers for directive argument or body. It translates a Success into a Right and a NoSuccess into a Left.

Utility method to be used by custom parsers for directive argument or body. It translates a Success into a Right and a NoSuccess into a Left.

Attributes

def parseDirectivePart(parser: RecursiveSpanParser, source: SourceFragment): Either[String, Seq[Span]]

Utility method to be used by custom parsers for directive argument or body. It translates a Success into a Right and a NoSuccess into a Left.

Utility method to be used by custom parsers for directive argument or body. It translates a Success into a Right and a NoSuccess into a Left.

Attributes

def standardSpans(p: RecursiveParsers)(input: SourceFragment): Either[String, Seq[Span]]

Parses all standard inline markup supported by reStructuredText.

Parses all standard inline markup supported by reStructuredText.

Value parameters

input

the input to parse

p

the standard inline parsers including all registered directives for recursive use

Attributes

Returns

Right in case of parser success and Left in case of failure, to adjust to the Directive API

def table(p: RecursiveParsers)(input: SourceFragment): Either[String, Block]

Parses one of the two table types supported by reStructuredText.

Parses one of the two table types supported by reStructuredText.

Value parameters

input

the input to parse

p

the standard block parsers including all registered directives for recursive use

Attributes

Returns

Right in case of parser success and Left in case of failure, to adjust to the Directive API

def target(p: RecursiveParsers)(input: SourceFragment): Either[String, Span]

Parses a target which might be a simple reference, a phrase reference or an uri.

Parses a target which might be a simple reference, a phrase reference or an uri.

Value parameters

input

the input to parse

Attributes

Returns

Right in case of parser success and Left in case of failure, to adjust to the Directive API

def unicode(input: SourceFragment): Either[String, String]

Parses unicode values in various notations intertwined with normal text.

Parses unicode values in various notations intertwined with normal text.

Value parameters

input

the input to parse

Attributes

Returns

Right in case of parser success and Left in case of failure, to adjust to the Directive API