Object

laika.format

Markdown

Related Doc: package format

Permalink

object Markdown extends MarkupParser

A parser for Markdown text. Instances of this class may be passed directly to the Parse or Transform APIs:

val document = Parse as Markdown fromFile "hello.md"

Transform from Markdown to HTML fromFile "hello.md" toFile "hello.html"

Since this library is not solely focused on producing HTML output, parsing verbatim HTML elements like defined by the official Markdown syntax description is an optional feature, as some types of renderers would not know what to do with HTML nodes in the document tree. It must be enabled explicitly:

val document = Parse.as(Markdown).withRawContent.fromFile("hello.md")

To switch off all custom extensions like directives, configuration sections at the start of the document or automatic id generation for headers, you can run the parser in strict mode:

Transform.from(Markdown).to(HTML).strict
  .fromFile("hello.md").toFile("hello.html")
Linear Supertypes
MarkupParser, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Markdown
  2. MarkupParser
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. object BundledDefaults extends ExtensionBundle

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val blockParsers: Seq[BlockParserBuilder]

    Permalink

    All block parsers for the markup language this parser processes.

    All block parsers for the markup language this parser processes.

    Definition Classes
    MarkdownMarkupParser
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def createBlockListParser(parser: Parser[Block]): Parser[Seq[Block]]

    Permalink

    Creates the parser for a sequence of blocks based on the parser for a single block.

    Creates the parser for a sequence of blocks based on the parser for a single block.

    The parser for a single block is already the result of merging all block parsers defined within this instance with all extension parsers defined by the user.

    The default implementation simply applies this parser repeatedly while skipping blank lines between the parsed blocks. This method can get overridden for special requirements, for example when the previous result has an influence on which parser to pick for the subsequent block.

    Definition Classes
    MarkdownMarkupParser
  9. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. lazy val escapedChar: Parser[String]

    Permalink

    Parses the character after the one that started the escape sequence (usually a backslash).

    Parses the character after the one that started the escape sequence (usually a backslash).

    The default implementation parses any character as is, this can be overridden in case the host language has more specific rules for escape sequences.

    Definition Classes
    MarkdownMarkupParser
  12. val extensions: Seq[ExtensionBundle]

    Permalink

    The parser-specific extensions that need to be installed for each transformation that involves this parser.

    The parser-specific extensions that need to be installed for each transformation that involves this parser.

    One scenario where a parser needs to provide a bundle is when it produces tree elements that are unknown to the built-in rewrite rules and renderers.

    Definition Classes
    MarkdownMarkupParser
  13. val fileSuffixes: Set[String]

    Permalink

    The file suffixes recognized by this parser.

    The file suffixes recognized by this parser. When transforming entire directories only files with names ending in one of the specified suffixes will be considered.

    It is recommended not to support txt or similarly common suffixes as this might interfere with other installed formats.

    Definition Classes
    MarkdownMarkupParser
  14. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. val spanParsers: Seq[SpanParserBuilder]

    Permalink

    All span parsers for the markup language this parser processes.

    All span parsers for the markup language this parser processes.

    Definition Classes
    MarkdownMarkupParser
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from MarkupParser

Inherited from AnyRef

Inherited from Any

Ungrouped