syntax

laika.io.syntax
object syntax

Implicits that add sequential[F[_]] and parallel[F[_]] methods to all builder instances for parsers, renderers and transformers from the laika-core module, adding support for file/stream IO, suspended in the effect of your choice.

The requirements for the effect are Sync for sequential execution and Async for parallel execution.

Example for transforming an entire directory from Markdown to HTML using the parallel builder:

val transformer = Transformer
 .from(Markdown)
 .to(HTML)
 .using(GitHubFlavor)
 .parallel[IO](4)
 .build

val res: IO[Unit] = transformer.use {
 _.fromDirectory("src")
  .toDirectory("target")
  .transform
}

These variants of parser, renderer and transformer are the most powerful of the library, and the only options that support templating, style sheets and the copying of static files from input to output directory.

This API can be used to produce an entire HTML site or e-books in the EPUB or PDF format. It is also the basis of all tasks in the sbt plugin, that only adds a thin layer of sbt tasks and settings on top of the library API.

The tree for all internal processing steps is based on a virtual path, where in case of directory input and output the root of the virtual tree is mapped to the directory. This abstraction allows the merging of multiple input directories or the addition of inputs constructed in memory to those obtained from the file system.

In the case of binary output like EPUB or PDF, the document tree will be rendered to a single, merged output. In case of HTML the output is a tree of separate HTML documents. The API adjusts to the format in use, e.g. EPUB and PDF transformers will offer a fromDirectory ... toFile flow whereas HTML will offer fromDirectory ... toDirectory.

Attributes

Source
syntax.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
syntax.type

Members list

Type members

Classlikes

Attributes

Source
syntax.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Source
syntax.scala
Supertypes
class Object
trait Matchable
class Any
implicit class ParserSyntax(builder: ParserBuilder)

Attributes

Source
syntax.scala
Supertypes
class Object
trait Matchable
class Any
implicit class TextRendererSyntax(builder: RendererBuilder[_])

Attributes

Source
syntax.scala
Supertypes
class Object
trait Matchable
class Any
implicit class TextTransformerSyntax(builder: TransformerBuilder[_])

Attributes

Source
syntax.scala
Supertypes
class Object
trait Matchable
class Any

Implicits

Implicits

Attributes

Source
syntax.scala
final implicit def ParserSyntax(builder: ParserBuilder): ParserSyntax

Attributes

Source
syntax.scala
final implicit def TextRendererSyntax(builder: RendererBuilder[_]): TextRendererSyntax

Attributes

Source
syntax.scala

Attributes

Source
syntax.scala