EPUB

laika.format.EPUB$
case object EPUB extends TwoPhaseRenderFormat[HTMLFormatter, BinaryPostProcessorBuilder]

A post processor for EPUB output, based on an interim HTML renderer. May be directly passed to the Renderer or Transformer APIs:

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

val res: IO[Unit] = transformer
 .fromDirectory("src")
 .toFile("demo.epub")
 .transform

In the example above the input from an entire directory gets merged into a single output file.

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait TwoPhaseRenderFormat[HTMLFormatter, BinaryPostProcessorBuilder]
trait Format
class Object
trait Matchable
class Any
Show all
Self type
EPUB.type

Members list

Type members

Classlikes

case class BookConfig(metadata: DocumentMetadata, navigationDepth: Option[Int], fonts: Seq[FontDefinition], coverImage: Option[Path])

Configuration options for the generated EPUB output.

Configuration options for the generated EPUB output.

The duplication of the existing BookConfig instance from laika-core happens to have a different implicit key association with the EPUB-specific instance.

Value parameters

coverImage

the path to the cover image within the virtual document tree

fonts

the fonts that should be embedded in the EPUB container

metadata

the metadata associated with the document

navigationDepth

the number of levels to generate a table of contents for

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object BookConfig

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
BookConfig.type

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ScriptedTemplate extends Product

Configuration Enumeration that indicates whether an EPUB template contains scripting.

Configuration Enumeration that indicates whether an EPUB template contains scripting.

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes
object Always.type
object Auto.type
object Never.type
object XHTML extends RenderFormat[HTMLFormatter]

A render format for XHTML output as used by EPUB output.

A render format for XHTML output as used by EPUB output.

This format is usually not used directly with Laika's Render or Transform APIs. It is primarily used internally by the parent EPUB instance.

Attributes

Supertypes
trait RenderFormat[HTMLFormatter]
trait Format
class Object
trait Matchable
class Any
Self type
XHTML.type

Inherited types

type MirroredElemLabels = EmptyTuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Singleton
type MirroredElemTypes = EmptyTuple

Attributes

Inherited from:
Singleton
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

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

The mirrored *-type

The mirrored *-type

Attributes

Inherited from:
Singleton
type MirroredType = Singleton.this.type

Attributes

Inherited from:
Singleton

Value members

Concrete methods

Produces an EPUB container from the specified result tree.

Produces an EPUB container from the specified result tree.

It includes the following files in the container:

  • All text markup in the provided document tree, transformed to HTML by the specified render function.
  • All static content in the provided document tree, copied to the same relative path within the EPUB container.
  • Metadata and navigation files as required by the EPUB specification, auto-generated from the document tree and the configuration of this instance.

Attributes

def prepareTree(root: DocumentTreeRoot): Either[Throwable, DocumentTreeRoot]

Adds a cover image (if specified in the configuration) and a fallback CSS resource (if the input tree did not contain any CSS), before the tree gets passed to the XHTML renderer.

Adds a cover image (if specified in the configuration) and a fallback CSS resource (if the input tree did not contain any CSS), before the tree gets passed to the XHTML renderer.

Attributes

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
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

val interimFormat: RenderFormat[HTMLFormatter]

The render format for the interim result, the first phase of this renderer.

The render format for the interim result, the first phase of this renderer.

Attributes