ReStructuredText

laika.format.ReStructuredText
case object ReStructuredText extends MarkupFormat

A parser for text written in reStructuredText markup. Instances of this class may be passed directly to the Parseer or Transformer APIs:

val document = MarkupParser.of(ReStructuredText).build.parse(inputString)

Transformer.from(ReStructuredText).to(HTML).build.transform(inputString)

In addition to the implementing the standard reStructuredText directives, the Laika APIs also supports a custom directive type unique to Laika. They represent a library-wide extension mechanism and allow you to implement tags which can be used in any of the supported markup formats or in templates.

Laika directives can be registered with the laika.api.bundle.DirectiveRegistry extension bundle.

Attributes

Source
ReStructuredText.scala
Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait MarkupFormat
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Classlikes

Attributes

Source
ReStructuredText.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Source
ReStructuredText.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Inherited types

type MirroredElemLabels = EmptyTuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Singleton
Source
Mirror.scala
type MirroredElemTypes = EmptyTuple

Attributes

Inherited from:
Singleton
Source
Mirror.scala
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredMonoType = Singleton.this.type

The mirrored *-type

The mirrored *-type

Attributes

Inherited from:
Singleton
Source
Mirror.scala
type MirroredType = Singleton.this.type

Attributes

Inherited from:
Singleton
Source
Mirror.scala

Value members

Concrete methods

override def createBlockListParser(parser: Parser[Block]): Parser[Seq[Block]]

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.

Attributes

Definition Classes
Source
ReStructuredText.scala

Inherited methods

def fromProduct(p: Product): MirroredMonoType

Create a new instance of type T with elements taken from product p.

Create a new instance of type T with elements taken from product p.

Attributes

Inherited from:
Singleton
Source
Mirror.scala
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

override val description: String

Short string describing the markup or output format for tooling and logging.

Short string describing the markup or output format for tooling and logging.

Attributes

Source
ReStructuredText.scala
lazy override val escapedChar: Parser[String]

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.

Attributes

Source
ReStructuredText.scala

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.

Attributes

Source
ReStructuredText.scala
val fileSuffixes: Set[String]

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.

Attributes

Source
ReStructuredText.scala