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 consired.
It is recommended not to support txt
or similarly common suffixes as this might interfere
with other installed formats.
The actual parser function, fully parsing the specified input and returning a document tree.
The actual parser function, fully parsing the specified input and returning a document tree.
Turns strict mode on for the returned parser, switching off any features not part of the reStructuredText specification.
Turns strict mode on for the returned parser, switching off any features not part of the reStructuredText specification. This includes the Laika variant of directives as well as configuration sections at the start of the document.
Adds the specified directives and returns a new instance of the parser.
Adds the specified directives and returns a new instance of the parser. These block directives may then be used anywhere in documents parsed by this instance.
Example:
case class Note (title: String, content: Seq[Block]) extends Block with BlockContainer[Note] val rst = ReStructuredText withBlockDirectives ( BlockDirective("note") { (argument() ~ blockContent)(Note) } ) Transform from rst to HTML fromFile "hello.rst" toFile "hello.html"
For more details on implementing directives see laika.parse.rst.Directives.
Specifies the name of the default text role to apply when interpreted text is used in markup without an explicit role name.
Specifies the name of the default text role to apply when interpreted text is used in markup without an explicit role name.
Adds the specified Laika directives and returns a new instance of the parser.
Adds the specified Laika directives and returns a new instance of the parser.
Example:
case class Note (title: String, content: Seq[Block], options: Options = NoOpt) extends Block with BlockContainer[Note] val rst = ReStructuredText withLaikaBlockDirectives ( Blocks.create("note") { (attribute(Default) ~ body(Default))(Note(_,_)) } ) Transform from rst to HTML fromFile "hello.rst" toFile "hello.html"
For more details on implementing Laika directives see laika.directives.Directives.
Adds the specified Laika directives and returns a new instance of the parser.
Adds the specified Laika directives and returns a new instance of the parser.
Example:
val rst = ReStructuredText withLaikaSpanDirectives ( Spans.create("ticket") { (attribute(Default) ~ attribute("param").optional) { (ticketNo, param) => val base = "http://tickets.service.com/"+ticketNo val url = base + (param map (p => "¶m="+p) getOrElse "") ExternalLink(Seq(Text("Ticket "+ticketNo)), url, options = Styles("ticket")) } } ) Transform from rst to HTML fromFile "hello.rst" toFile "hello.html"
For more details on implementing Laika directives see laika.directives.Directives.
Adds the raw
directive and text roles to the parser.
Adds the raw
directive and text roles to the parser.
These are disabled by default as they present a potential security risk.
Adds the specified directives and returns a new instance of the parser.
Adds the specified directives and returns a new instance of the parser. These span directives can then be referred to by substitution references.
Example:
val rst = ReStructuredText withSpanDirectives ( SpanDirective("replace") { spanContent map SpanSequence } ) Transform from rst to HTML fromFile "hello.rst" toFile "hello.html"
For more details on implementing directives see laika.parse.rst.Directives.
Adds the specified text roles and returns a new instance of the parser.
Adds the specified text roles and returns a new instance of the parser. These text roles may then be used in interpreted text spans.
Example:
val rst = ReStructuredText withTextRoles ( TextRole("link", "http://www.our-server.com/tickets/")(field("base-url")) { (base, text) => Link(List(Text(text)), base + text) } ) Transform from rst to HTML fromFile "hello.rst" toFile "hello.html"
For more details on implementing directives see laika.parse.rst.TextRoles.
The default reStructuredText parser configuration, without any directives or text roles installed.