laika.directive

DirectiveParsers

trait DirectiveParsers extends InlineParsers

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

Linear Supertypes
InlineParsers, MarkupParsers, BaseParsers, RegexParsers, Parsers, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DirectiveParsers
  2. InlineParsers
  3. MarkupParsers
  4. BaseParsers
  5. RegexParsers
  6. Parsers
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract class DirectiveContextBase extends AnyRef

  2. type Elem = Char

    Definition Classes
    RegexParsers → Parsers
  3. case class Error extends NoSuccess with Product with Serializable

    Definition Classes
    Parsers
  4. case class Failure extends NoSuccess with Product with Serializable

    Definition Classes
    Parsers
  5. type Input = Reader[Elem]

    Definition Classes
    Parsers
  6. class MarkupParserException extends RuntimeException

    Exception thrown when parsing a text markup document or fragment fails.

  7. sealed abstract class NoSuccess extends ParseResult[Nothing]

    Definition Classes
    Parsers
  8. trait OnceParser[+T] extends Parser[T]

    Definition Classes
    Parsers
  9. sealed abstract class ParseResult[+T] extends AnyRef

    Definition Classes
    Parsers
  10. case class ParsedDirective(name: String, parts: List[Part]) extends Product with Serializable

    Represents the parsed but unprocessed content of a directive.

  11. abstract class Parser[+T] extends (Input) ⇒ ParseResult[T]

    Definition Classes
    Parsers
  12. class ParserOps[A] extends AnyRef

    Provides additional combinator methods to parsers via implicit conversion.

  13. case class Part(key: Key, content: String) extends Product with Serializable

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

  14. type PartMap = Map[Key, String]

  15. trait ResultBuilder[Elem, +To] extends AnyRef

    Abstracts the internal process of building up the result of an inline parser.

  16. class SpanBuilder extends ResultBuilder[Span, List[Span]]

    ResultBuilder that produces a list of spans.

  17. case class Success[+T] extends ParseResult[T] with Product with Serializable

    Definition Classes
    Parsers
  18. class TextBuilder extends ResultBuilder[String, String]

    ResultBuilder that produces a String.

  19. class TextParser extends Parser[String]

    API for specifying further constraints on the parsers provided by this base trait.

  20. case class ~[+a, +b] extends Product with Serializable

    Definition Classes
    Parsers

Abstract Value Members

  1. abstract def prepareSpanParsers: Map[Char, Parser[Span]]

    Extension hook for modifying the default span parser map.

    Extension hook for modifying the default span parser map. The default implementation returns the specified parser unchanged.

    Attributes
    protected
    Definition Classes
    InlineParsers

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object NoSuccess

    Definition Classes
    Parsers
  7. def OnceParser[T](f: (Input) ⇒ ParseResult[T]): Parser[T] with OnceParser[T]

    Definition Classes
    Parsers
  8. def Parser[T](f: (Input) ⇒ ParseResult[T]): Parser[T]

    Definition Classes
    Parsers
  9. def accept[U](expected: String, f: PartialFunction[Elem, U]): Parser[U]

    Definition Classes
    Parsers
  10. def accept[ES](es: ES)(implicit arg0: (ES) ⇒ List[Elem]): Parser[List[Elem]]

    Definition Classes
    Parsers
  11. implicit def accept(e: Elem): Parser[Elem]

    Definition Classes
    Parsers
  12. def acceptIf(p: (Elem) ⇒ Boolean)(err: (Elem) ⇒ String): Parser[Elem]

    Definition Classes
    Parsers
  13. def acceptMatch[U](expected: String, f: PartialFunction[Elem, U]): Parser[U]

    Definition Classes
    Parsers
  14. def acceptSeq[ES](es: ES)(implicit arg0: (ES) ⇒ Iterable[Elem]): Parser[List[Elem]]

    Definition Classes
    Parsers
  15. val any: TextParser

    Consumes any kind of input, always succeeds.

    Consumes any kind of input, always succeeds. This parser would consume the entire input unless a max constraint is specified.

    Definition Classes
    MarkupParsers
  16. def anyBut(chars: Char*): TextParser

    Consumes any number of consecutive characters that are not one of the specified characters.

    Consumes any number of consecutive characters that are not one of the specified characters. Always succeeds unless a minimum number of required matches is specified.

    Definition Classes
    MarkupParsers
  17. def anyIn(ranges: Traversable[Char]*): TextParser

    Consumes any number of consecutive characters that are in one of the specified character ranges.

    Consumes any number of consecutive characters that are in one of the specified character ranges. Always succeeds unless a minimum number of required matches is specified.

    Definition Classes
    MarkupParsers
  18. def anyOf(chars: Char*): TextParser

    Consumes any number of consecutive occurrences of the specified characters.

    Consumes any number of consecutive occurrences of the specified characters. Always succeeds unless a minimum number of required matches is specified.

    Definition Classes
    MarkupParsers
  19. def anyUntil(until: ⇒ Parser[Any]): TextParser

    Consumes any number of characters for which the specified parser fails on the corresponding offset.

    Consumes any number of characters for which the specified parser fails on the corresponding offset. This parser fails if the end of input is reached without the specified parser ever succeeding or if the parser causes an Error result instead of a plain Failure or Success. Further constraints like minimum or maximum number of required matching characters can be specified through the API of the returned TextParser instance.

    Definition Classes
    MarkupParsers
  20. def anyUntil(chars: Char*): TextParser

    Consumes any number of consecutive characters that are not one of the specified characters.

    Consumes any number of consecutive characters that are not one of the specified characters.

    This parser is identical to the anyBut parser except for two differences: this parser fails if it reaches the end of the input without seeing any of the specified characters and it also consumes this final character, without adding it to the result. This parser is usually used when a construct like a span enclosed between two characters needs to be parsed.

    Definition Classes
    MarkupParsers
  21. def anyWhile(p: (Char) ⇒ Boolean): TextParser

    Consumes any number of consecutive characters which satisfy the specified predicate.

    Consumes any number of consecutive characters which satisfy the specified predicate. Always succeeds unless a minimum number of required matches is specified.

    Definition Classes
    MarkupParsers
  22. def applyDirective[E <: Element](builder: BuilderContext[E])(parseResult: ParsedDirective, directives: (String) ⇒ Option[Directive], createContext: (PartMap, Option[DocumentContext]) ⇒ DirectiveContext, createPlaceholder: ((DocumentContext) ⇒ E) ⇒ E, createInvalidElement: (String) ⇒ E, directiveTypeDesc: String): E

    Attributes
    protected
  23. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  24. val atStart: Parser[Parser[Unit]]

    Succeeds at the start of the input.

    Succeeds at the start of the input.

    Definition Classes
    MarkupParsers
  25. def chainl1[T, U](first: ⇒ Parser[T], p: ⇒ Parser[U], q: ⇒ Parser[(T, U) ⇒ T]): Parser[T]

    Definition Classes
    Parsers
  26. def chainl1[T](p: ⇒ Parser[T], q: ⇒ Parser[(T, T) ⇒ T]): Parser[T]

    Definition Classes
    Parsers
  27. def chainr1[T, U](p: ⇒ Parser[T], q: ⇒ Parser[(T, U) ⇒ U], combine: (T, U) ⇒ U, first: U): Parser[U]

    Definition Classes
    Parsers
  28. implicit def charToTraversalble(char: Char): Traversable[Char]

    Implicit conversion that allows to pass a single character to the range-based anyIn parser.

    Implicit conversion that allows to pass a single character to the range-based anyIn parser.

    Definition Classes
    MarkupParsers
  29. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. def commit[T](p: ⇒ Parser[T]): Parser[T]

    Definition Classes
    Parsers
  31. lazy val declaration: Parser[(String, List[Part])]

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

  32. def directiveParser(bodyContent: Parser[String], includeStartChar: 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.

    bodyContent

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

    includeStartChar

    indicates whether the starting '@' has to be parsed by this parser

  33. def elem(e: Elem): Parser[Elem]

    Definition Classes
    Parsers
  34. def elem(kind: String, p: (Elem) ⇒ Boolean): Parser[Elem]

    Definition Classes
    Parsers
  35. def eof: Parser[String]

    Succeeds at the end of the input.

    Succeeds at the end of the input.

    Definition Classes
    MarkupParsers
  36. def eol: Parser[String]

    Succeeds at the end of a line, including the end of the input.

    Succeeds at the end of a line, including the end of the input. Produces an empty string as a result and consumes any new line characters.

    Definition Classes
    MarkupParsers
  37. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  38. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  39. def err(msg: String): Parser[Nothing]

    Definition Classes
    Parsers
  40. def failure(msg: String): Parser[Nothing]

    Definition Classes
    Parsers
  41. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  42. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  43. def guard[T](p: ⇒ Parser[T]): Parser[T]

    Definition Classes
    Parsers
  44. def handleWhiteSpace(source: CharSequence, offset: Int): Int

    Attributes
    protected
    Definition Classes
    RegexParsers
  45. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  46. def inline[Elem, To](text: ⇒ TextParser, nested: ⇒ Map[Char, Parser[Elem]], resultBuilder: ⇒ ResultBuilder[Elem, To]): Parser[To]

    Generic base parser that parses inline elements based on the specified helper parsers.

    Generic base parser that parses inline elements based on the specified helper parsers. Usually not used directly by parser implementations, this is the base parser the other inline parsers of this trait delegate to.

    Elem

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

    To

    the type of the result this parser produces

    nested

    a mapping from the start character of a span to the corresponding parser for nested span elements

    resultBuilder

    responsible for building the final result of this parser based on the results of the helper parsers

    returns

    the resulting parser

    Definition Classes
    InlineParsers
  47. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  48. implicit def literal(s: String): Parser[String]

    Definition Classes
    RegexParsers
  49. def log[T](p: ⇒ Parser[T])(name: String): Parser[T]

    Definition Classes
    Parsers
  50. def lookBehind[T](offset: Int, parser: ⇒ Parser[T]): Parser[T]

    Applies the specified parser at the specified offset behind the current position.

    Applies the specified parser at the specified offset behind the current position. Never consumes any input.

    Definition Classes
    BaseParsers
  51. def mkList[T]: (~[T, List[T]]) ⇒ List[T]

    Definition Classes
    Parsers
  52. lazy val nameDecl: Parser[String]

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

  53. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  54. def not[T](p: ⇒ Parser[T]): Parser[Unit]

    Definition Classes
    Parsers
  55. final def notify(): Unit

    Definition Classes
    AnyRef
  56. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  57. def opt[T](p: ⇒ Parser[T]): Parser[Option[T]]

    Definition Classes
    Parsers
  58. def optimizedCharLookup(chars: Char*): (Char) ⇒ Boolean

    Returns an optimized, Array-based lookup function for the specified characters.

    Returns an optimized, Array-based lookup function for the specified characters.

    Attributes
    protected
    Definition Classes
    MarkupParsers
  59. def optimizedRangeLookup(ranges: Traversable[Char]*): (Char) ⇒ Boolean

    Returns an optimized, Array-based lookup function for the specified ranges of characters.

    Returns an optimized, Array-based lookup function for the specified ranges of characters.

    Attributes
    protected
    Definition Classes
    MarkupParsers
  60. def parse[T](p: Parser[T], in: Reader): ParseResult[T]

    Definition Classes
    RegexParsers
  61. def parse[T](p: Parser[T], in: CharSequence): ParseResult[T]

    Definition Classes
    RegexParsers
  62. def parse[T](p: Parser[T], in: Reader[Char]): ParseResult[T]

    Definition Classes
    RegexParsers
  63. def parseAll[T](p: Parser[T], in: CharSequence): ParseResult[T]

    Definition Classes
    RegexParsers
  64. def parseAll[T](p: Parser[T], in: Reader): ParseResult[T]

    Definition Classes
    RegexParsers
  65. def parseAll[T](p: Parser[T], in: Reader[Char]): ParseResult[T]

    Definition Classes
    RegexParsers
  66. def parseInline(source: String): List[Span]

    Fully parses the input string and produces a list of spans, using the default span parsers returned by the spanParsers method.

    Fully parses the input string and produces a list of spans, using the default span parsers returned by the spanParsers method.

    This function is expected to always succeed, errors would be considered a bug of this library, as the parsers treat all unknown or malformed markup as regular text. Some parsers might additionally insert system message elements in case of markup errors.

    source

    the input to parse

    returns

    the result of the parser in form of a list of spans

    Definition Classes
    InlineParsers
  67. def parseInline(source: String, spanParsers: Map[Char, Parser[Span]]): List[Span]

    Fully parses the input string and produces a list of spans.

    Fully parses the input string and produces a list of spans.

    This function is expected to always succeed, errors would be considered a bug of this library, as the parsers treat all unknown or malformed markup as regular text. Some parsers might additionally insert system message elements in case of markup errors.

    source

    the input to parse

    spanParsers

    a mapping from the start character of a span to the corresponding parser

    returns

    the result of the parser in form of a list of spans

    Definition Classes
    InlineParsers
  68. def parseMarkup[T](parser: Parser[T], reader: Reader[Char]): T

    Fully parses the input from the specified reader and returns the result.

    Fully parses the input from the specified reader and returns the result. This function is expected to always succeed, errors would be considered a bug in this library, as the parsers treat all unknown or malformed markup as regular text.

    Definition Classes
    MarkupParsers
  69. def parseMarkup[T](parser: Parser[T], source: String): T

    Fully parses the specified input string and returns the result.

    Fully parses the specified input string and returns the result. This function is expected to always succeed, errors would be considered a bug in this library, as the parsers treat all unknown or malformed markup as regular text.

    Definition Classes
    MarkupParsers
  70. def phrase[T](p: Parser[T]): Parser[T]

    Definition Classes
    RegexParsers → Parsers
  71. def positioned[T <: Positional](p: ⇒ Parser[T]): Parser[T]

    Definition Classes
    RegexParsers → Parsers
  72. implicit def regex(r: Regex): Parser[String]

    Definition Classes
    RegexParsers
  73. def rep[T](first: ⇒ Parser[T], next: (T) ⇒ Parser[T]): Parser[List[T]]

    A parser generator for repetitions where all subsequent parsers after the first depend on the result of the previous.

    A parser generator for repetitions where all subsequent parsers after the first depend on the result of the previous.

    first

    the parser to use for the first piece of input

    next

    a function that determines the next parser based on the result of the previous

    Definition Classes
    BaseParsers
  74. def rep[T](p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  75. def rep1[T](first: ⇒ Parser[T], p0: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
    Annotations
    @migration
    Migration

    (Changed in version 2.9.0) The p0 call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.

  76. def rep1[T](p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  77. def rep1sep[T](p: ⇒ Parser[T], q: ⇒ Parser[Any]): Parser[List[T]]

    Definition Classes
    Parsers
  78. def repMax[T](num: Int, p: ⇒ Parser[T]): Parser[List[T]]

    Uses the parser for at most the specified number of repetitions, always succeeds.

    Uses the parser for at most the specified number of repetitions, always succeeds. The result is the list of results from applying the parser repeatedly.

    Definition Classes
    BaseParsers
  79. def repMin[T](num: Int, p: ⇒ Parser[T]): Parser[List[T]]

    Uses the parser for at least the specified number of repetitions or otherwise fails.

    Uses the parser for at least the specified number of repetitions or otherwise fails. Continues to apply the parser after the minimum has been reached until if fails. The result is the list of results from applying the parser repeatedly.

    Definition Classes
    BaseParsers
  80. def repN[T](num: Int, p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  81. def repsep[T](p: ⇒ Parser[T], q: ⇒ Parser[Any]): Parser[List[T]]

    Definition Classes
    Parsers
  82. def skipWhitespace: Boolean

    Definition Classes
    MarkupParsers → RegexParsers
  83. final lazy val spanParsers: Map[Char, Parser[Span]]

    The mapping of markup start characters to their corresponding span parsers.

    The mapping of markup start characters to their corresponding span parsers.

    A parser mapped to a start character is not required to successfully parse the subsequent input. If it fails the character that triggered the parser invocation will be treated as normal text. The mapping is merely used as a performance optimization. The parser will be invoked with the input offset pointing to the character after the one specified as the key for the mapping.

    Definition Classes
    InlineParsers
  84. def spans(parser: ⇒ TextParser, spanParsers: ⇒ Map[Char, Parser[Span]]): Parser[List[Span]]

    Parses a list of spans based on the specified helper parsers.

    Parses a list of spans based on the specified helper parsers.

    parser

    the parser for the text of the current span element

    returns

    the resulting parser

    Definition Classes
    InlineParsers
  85. def success[T](v: T): Parser[T]

    Definition Classes
    Parsers
  86. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  87. def text(parser: ⇒ TextParser, nested: ⇒ Map[Char, Parser[String]]): Parser[String]

    Parses text based on the specified helper parsers.

    Parses text based on the specified helper parsers.

    parser

    the parser for the text of the current element

    nested

    a mapping from the start character of a span to the corresponding parser for nested span elements

    returns

    the resulting parser

    Definition Classes
    InlineParsers
  88. implicit def toParserOps[A](parser: Parser[A]): ParserOps[A]

    Definition Classes
    BaseParsers
  89. def toString(): String

    Definition Classes
    AnyRef → Any
  90. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  91. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  92. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  93. val whiteSpace: Regex

    Attributes
    protected
    Definition Classes
    RegexParsers
  94. def withSource[T](p: Parser[T]): Parser[(T, String)]

    Groups the result of the parser and the source string that it successfully parsed into a tupled result.

  95. def ws: TextParser

    Parses horizontal whitespace (space and tab).

    Parses horizontal whitespace (space and tab). Always succeeds, consuming all whitespace found.

    Definition Classes
    MarkupParsers
  96. lazy val wsOrNl: TextParser

    Parses horizontal whitespace or newline characters.

Deprecated Value Members

  1. def lastNoSuccess: NoSuccess

    Definition Classes
    Parsers
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) lastNoSuccess was not thread-safe and will be removed in 2.11.0

  2. def lastNoSuccess_=(x: NoSuccess): Unit

    Definition Classes
    Parsers
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) lastNoSuccess was not thread-safe and will be removed in 2.11.0

Inherited from InlineParsers

Inherited from MarkupParsers

Inherited from BaseParsers

Inherited from RegexParsers

Inherited from Parsers

Inherited from AnyRef

Inherited from Any

Ungrouped