laika.template.TemplateParsers

MarkupSpans

trait MarkupSpans extends TemplateParsers with SpanDirectives

Parsers specific to inline elements in text markup.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MarkupSpans
  2. SpanDirectives
  3. DirectiveParsers
  4. TemplateParsers
  5. InlineParsers
  6. MarkupParsers
  7. BaseParsers
  8. RegexParsers
  9. Parsers
  10. AnyRef
  11. 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

    Definition Classes
    DirectiveParsers
  2. case class DirectiveSpan(f: (DocumentCursor) ⇒ Span, options: Options = laika.tree.Elements.NoOpt) extends Element with SpanResolver with Product with Serializable

    Definition Classes
    SpanDirectives
  3. type Elem = Char

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

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

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

    Definition Classes
    Parsers
  7. class MarkupParserException extends RuntimeException

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

  8. sealed abstract class NoSuccess extends ParseResult[Nothing]

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

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

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

    Represents the parsed but unprocessed content of a directive.

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

    Definition Classes
    Parsers
  13. implicit class ParserOps[A] extends AnyRef

    Provides additional combinator methods to parsers via implicit conversion.

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

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

  15. type PartMap = Map[Key, String]

    Definition Classes
    DirectiveParsers
  16. trait ResultBuilder[Elem, +To] extends AnyRef

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

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

    ResultBuilder that produces a list of spans.

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

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

    ResultBuilder that produces a String.

  20. class TextParser extends Parser[String]

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

  21. implicit class TryOps[A] extends AnyRef

    Provides additional methods to Try via implicit conversion.

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

    Definition Classes
    Parsers

Abstract Value Members

  1. abstract def getSpanDirective(name: String): Option[directive.Directives.Spans.Directive]

    Definition Classes
    SpanDirectives

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[DocumentCursor]) ⇒ DirectiveContext, createPlaceholder: ((DocumentCursor) ⇒ E) ⇒ E, createInvalidElement: (String) ⇒ E, directiveTypeDesc: String): E

    Attributes
    protected
    Definition Classes
    DirectiveParsers
  23. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  24. val atStart: 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 charToTraversable(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.

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

    Definition Classes
    DirectiveParsers
  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

    Definition Classes
    DirectiveParsers
  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. lazy val escapedChar: Parser[String]

    Parses a single escape character.

    Parses a single escape character. In the default implementation any character can be escaped. Sub-traits may override this parser to restrict the number of escapable characters.

    Definition Classes
    InlineParsers
  41. def escapedText(p: TextParser): Parser[String]

    Adds support for escape sequences to the specified text parser.

    Adds support for escape sequences to the specified text parser.

    p

    the parser to add support for escape sequences to

    returns

    a parser for a text span that supports escape sequences

    Definition Classes
    InlineParsers
  42. def escapedUntil(char: Char*): Parser[String]

    Parses a span of text until one of the specified characters is seen (unless it is escaped), while also processing escaped characters, but no other nested spans.

    Parses a span of text until one of the specified characters is seen (unless it is escaped), while also processing escaped characters, but no other nested spans. The final character is not included in the result.

    char

    the character that signals the end of the text span

    returns

    a parser for a text span that supports escape sequences

    Definition Classes
    InlineParsers
  43. def failure(msg: String): Parser[Nothing]

    Definition Classes
    Parsers
  44. def finalize(): Unit

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

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

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

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

    Definition Classes
    AnyRef → Any
  49. 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

    text

    the parser for the text of the current span element

    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
  50. final def isInstanceOf[T0]: Boolean

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

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

    Definition Classes
    Parsers
  53. 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
  54. def mkList[T]: (~[T, List[T]]) ⇒ List[T]

    Definition Classes
    Parsers
  55. 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 '_'.

    Definition Classes
    DirectiveParsers
  56. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  57. val nestedBraces: Parser[Text]

    Attributes
    protected
    Definition Classes
    DirectiveParsers
  58. def not[T](p: ⇒ Parser[T]): Parser[Unit]

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

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

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

    Definition Classes
    Parsers
  62. 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
  63. 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
  64. def parse[T](p: Parser[T], in: Reader): ParseResult[T]

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

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

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

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

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

    Definition Classes
    RegexParsers
  70. 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
  71. 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
  72. 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
  73. 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
  74. def phrase[T](p: Parser[T]): Parser[T]

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

    Definition Classes
    RegexParsers → Parsers
  76. 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
    MarkupSpansInlineParsers
  77. val refName: Parser[String]

    Parses a simple reference name that only allows alphanumerical characters and the punctuation characters -, _, ., :, +.

    Parses a simple reference name that only allows alphanumerical characters and the punctuation characters -, _, ., :, +.

    Definition Classes
    MarkupParsers
  78. def reference[T](f: (String) ⇒ T): Parser[T]

    Parses a reference enclosed between {{ and }}.

    Parses a reference enclosed between {{ and }}.

    Definition Classes
    TemplateParsers
  79. implicit def regex(r: Regex): Parser[String]

    Definition Classes
    RegexParsers
  80. 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
  81. def rep[T](p: ⇒ Parser[T]): Parser[List[T]]

    Definition Classes
    Parsers
  82. 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.

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

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

    Definition Classes
    Parsers
  85. 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
  86. 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
  87. def repN[T](num: Int, p: ⇒ Parser[T]): Parser[List[T]]

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

    Definition Classes
    Parsers
  89. def skipWhitespace: Boolean

    Definition Classes
    MarkupParsers → RegexParsers
  90. lazy val spanDirectiveParser: Parser[Span]

    Definition Classes
    SpanDirectives
  91. 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
  92. 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

    spanParsers

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

    returns

    the resulting parser

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

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

    Definition Classes
    AnyRef
  95. 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
  96. def toString(): String

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

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

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

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

    Attributes
    protected
    Definition Classes
    RegexParsers
  101. 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.

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

    Definition Classes
    DirectiveParsers
  102. def ws: TextParser

    Parses horizontal whitespace (space and tab).

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

    Definition Classes
    MarkupParsers
  103. lazy val wsOrNl: TextParser

    Parses horizontal whitespace or newline characters.

    Parses horizontal whitespace or newline characters.

    Definition Classes
    DirectiveParsers

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 SpanDirectives

Inherited from DirectiveParsers

Inherited from TemplateParsers

Inherited from InlineParsers

Inherited from MarkupParsers

Inherited from BaseParsers

Inherited from RegexParsers

Inherited from Parsers

Inherited from AnyRef

Inherited from Any

Ungrouped