Packages

p

laika.io

model

package model

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. case class BinaryInput[F[_]](path: Path, stream: () ⇒ InputStream, formats: TargetFormats = TargetFormats.All, autoClose: Boolean = true, sourceFile: Option[File] = None)(implicit evidence$1: Sync[F]) extends Navigatable with Product with Serializable

    A binary input stream and its virtual path within the input tree.

  2. case class BinaryOutput[F[_]](path: Path, resource: Resource[F, OutputStream], targetFile: Option[File] = None) extends Product with Serializable

    A resource for binary output.

    A resource for binary output.

    Most renderers write character data, but formats like PDF or EPUB require a binary stream to write to.

  3. case class DirectoryInput(directories: Seq[File], codec: Codec, docTypeMatcher: (Path) ⇒ DocumentType = DocumentTypeMatcher.base, fileFilter: (File) ⇒ Boolean = DirectoryInput.hiddenFileFilter, mountPoint: Path = Root) extends Product with Serializable

    A directory in the file system containing input documents for a tree transformation.

    A directory in the file system containing input documents for a tree transformation.

    The specified docTypeMatcher is responsible for determining the type of input (e.g. text markup, template, etc.) based on the (virtual) document path.

  4. case class DirectoryOutput(directory: File, codec: Codec) extends TreeOutput with Product with Serializable

    A directory as a target for a rendering operation of a document tree.

    A directory as a target for a rendering operation of a document tree.

    The specified codec will be used for writing all character output.

  5. sealed trait InputReader extends Product with Serializable
  6. case class InputTree[F[_]](textInputs: Seq[TextInput[F]] = Nil, binaryInputs: Seq[BinaryInput[F]] = Nil, parsedResults: Seq[ParserResult] = Nil, sourcePaths: Seq[String] = Nil) extends Product with Serializable

    A (virtual) tree of input documents, either obtained from scanning a directory recursively or constructed programmatically (or a mix of both).

    A (virtual) tree of input documents, either obtained from scanning a directory recursively or constructed programmatically (or a mix of both).

    Even though the documents are specified as a flat sequence, they logically form a tree based on their virtual path.

  7. class InputTreeBuilder[F[_]] extends AnyRef

    Builder API for freely constructing input trees from directories, files, classpath resources, in-memory strings or pre-constructed AST trees.

    Builder API for freely constructing input trees from directories, files, classpath resources, in-memory strings or pre-constructed AST trees.

    If your input is just one or more directories, you can use the corresponding shortcuts on the parser or transformer instances, e.g. transformer.fromDirectory(...).toDirectory(...). This builder is meant to be used for situations where more flexibility is required.

    All the specified inputs will be combined into a single logical tree and each document gets a virtual path assigned that describes its logical position within the tree. As a consequence all cross-linking or referencing of images can happen within the virtual path abstraction, meaning a resource from the file system can point to an input constructed in-memory via a relative, virtual path.

    When adding strings, files or directories you need to specify a "mount point" that signals where within the virtual tree the inputs should be placed. For adding directories the mount point is optional, when omitted the directory becomes the virtual root of the input tree.

    The resulting input tree can be passed to parsers, transformers and theme builders.

    Example for composing inputs from two directories, a template loaded from the classpath and a CSS file generated in-memory:

    val inputs = InputTree[F]
      .addDirectory("/path-to-my/markup-files")
      .addDirectory("/path-to-my/images", Root / "images")
      .addClasspathResource("my-templates/default.template.html", DefaultTemplatePath.forHTML)
      .addString(generateMyStyles(), Root / "css" / "site.css")

    These inputs can then be configured for the sbt plugin:

    laikaInputs := inputs

    Or passed to a TreeTransformer instance:

    val res: F[RenderedTreeRoot[F]] = transformer.use {
      _.fromInputTree(inputs)
       .toDirectory("target")
       .transform
    }
  8. sealed trait OutputWriter extends Product with Serializable
  9. case class ParsedTree[F[_]](root: DocumentTreeRoot, staticDocuments: Seq[BinaryInput[F]]) extends Product with Serializable

    The result of a parsing operation for an entire document tree.

    The result of a parsing operation for an entire document tree.

    The DocumentTreeRoot is the recursive structure of parsed inputs, like markup document, templates or other file types, represented by their AST.

    The static documents are merely a sequence of unprocessed inputs that have been discovered via directory scanning (or have been passed programmatically). The actual processing of these inputs is left to the render step, which might copy them into a target directory, or embed them into an output format like EPUB.

  10. case class PureReader(input: String) extends InputReader with Product with Serializable
  11. sealed trait RenderContent extends Navigatable

    A titled, positional element in the tree of rendered documents.

  12. case class RenderedDocument(path: Path, title: Option[SpanSequence], sections: Seq[SectionInfo], content: String, config: Config) extends RenderContent with DocumentNavigation with Product with Serializable

    A single rendered document with the content as a plain string in the target format.

    A single rendered document with the content as a plain string in the target format.

    The title and section info are still represented as an AST, so they be used in any subsequent step that needs to produce navigation structures.

  13. case class RenderedTree(path: Path, title: Option[SpanSequence], content: Seq[RenderContent], titleDocument: Option[RenderedDocument] = None) extends RenderContent with Product with Serializable

    Represents a node of the tree of rendered documents.

    Represents a node of the tree of rendered documents.

    path

    the full, absolute path of this (virtual) document tree

    title

    the title of this tree, either obtained from the title document or configuration

    content

    the rendered documents and subtrees in a recursive structure

    titleDocument

    the optional title document of this tree

  14. case class RenderedTreeRoot[F[_]](tree: RenderedTree, defaultTemplate: TemplateRoot, config: Config, styles: StyleDeclarationSet = StyleDeclarationSet.empty, coverDocument: Option[RenderedDocument] = None, staticDocuments: Seq[BinaryInput[F]] = Nil) extends Product with Serializable

    Represents the root of a tree of rendered documents.

    Represents the root of a tree of rendered documents. In addition to the recursive structure of documents it holds additional items like static or cover documents, which may contribute to the output of a site or an e-book.

    tree

    the recursive structure of documents, usually obtained from parsing text markup

    defaultTemplate

    the default template configured for the output format, which may be used by a post-processor

    config

    the root configuration of the rendered tree

    coverDocument

    the cover document (usually used with e-book formats like EPUB and PDF)

    staticDocuments

    the paths of documents that were neither identified as text markup, config or templates, and will potentially be embedded or copied as is to the final output, depending on the output format

  15. case class StreamReader(input: Reader, sizeHint: Int) extends InputReader with Product with Serializable
  16. case class StreamWriter(output: Writer) extends OutputWriter with Product with Serializable
  17. case class TextInput[F[_]](path: Path, docType: TextDocumentType, input: Resource[F, InputReader], sourceFile: Option[File] = None) extends Navigatable with Product with Serializable

    Character input for the various parsers of this library.

    Character input for the various parsers of this library.

    path

    The full virtual path of this input (does not represent the filesystem path in case of file I/O)

    docType

    Indicates the type of the document, to distinguish between text markup, templates, configuration and style sheets, which all have a different kind of parser

    input

    The resource to read the character input from

    sourceFile

    The source file from the file system, empty if this does not represent a file system resource

  18. case class TextOutput[F[_]](path: Path, resource: Resource[F, OutputWriter], targetFile: Option[File] = None) extends Product with Serializable

    Character output for the various renderers of this library

    Character output for the various renderers of this library

    path

    The full virtual path of this input (does not represent the filesystem path in case of file I/O)

    resource

    The resource to write the character output to

    targetFile

    The target file in the file system, empty if this does not represent a file system resource

  19. sealed trait TreeOutput extends AnyRef

    A (virtual) tree of output documents.

Value Members

  1. object BinaryInput extends Serializable
  2. object DirectoryInput extends Serializable
  3. object InputTree extends Serializable

    Factory methods for creating InputTreeBuilder instances.

  4. object PureWriter extends OutputWriter with Product with Serializable
  5. object StringTreeOutput extends TreeOutput with Product with Serializable

    Instructs the renderer to produce an in-memory representation of the tree of rendered outputs.

  6. object TextInput extends Serializable
  7. object TextOutput extends Serializable

Ungrouped