Provides all block parsers for Markdown text except for those dealing with verbatim HTML markup which this library treats as an optional feature that has to be explicitly mixed in.
Provides all inline parsers for Markdown text except for those dealing with verbatim HTML markup which this library treats as an optional feature that has to be explicitly mixed in.
Provides all inline parsers for Markdown text except for those dealing with verbatim HTML markup which this library treats as an optional feature that has to be explicitly mixed in.
Inline parsers deal with markup within a block of text, such as a link or emphasized text. They are used in the second phase of parsing, after the block parsers have cut the document into a (potentially nested) block structure.
A parser for Markdown text.
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 withVerbatimHTML) fromFile "hello.md"
The methods withSpanDirectives
and withBlockDirectives
allow to
register custom tags which will be processed by the parser in addition
to standard Markdown markup. For more details on directives see
laika.directive.Directives.
To switch this feature off alongside other custom extensions like 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.strict to HTML fromFile "hello.md" toFile "hello.html"
Provides all block parsers for Markdown text except for those dealing with verbatim HTML markup which this library treats as an optional feature that has to be explicitly mixed in.
Block parsers are only concerned with splitting the document into (potentially nested) blocks. They are used in the first phase of parsing, while delegating to inline parsers for the 2nd phase.