Class/Object

laika.api

Parse

Related Docs: object Parse | package api

Permalink

class Parse extends ParseConfigBuilder with InputOps with InputTreeOps

API for performing a parse operation from various types of input to obtain a document tree without a subsequent render operation.

In cases where a render operation should follow immediately, it is more convenient to use the laika.api.Transform API instead which combines a parse and a render operation directly.

Example for parsing Markdown from a file:

val doc = Parse as Markdown fromFile "hello.md"

Example for parsing from an entire directory:

val tree = Parse as Markdown fromDirectory "path/to/source"

Example for parsing a directory that contains markup documents in different formats:

val tree = Parse as Markdown or ReStructuredText fromDirectory "path/to/source"
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Parse
  2. InputTreeOps
  3. InputOps
  4. ParseConfigBuilder
  5. OperationConfigBuilder
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type InputResult = Document

    Permalink

    The type of the result returned by all operations of this trait.

    The type of the result returned by all operations of this trait.

    Definition Classes
    ParseInputOps
  2. type InputTreeResult = DocumentTree

    Permalink

    The type of the result returned by all operations of this trait.

    The type of the result returned by all operations of this trait.

    Definition Classes
    ParseInputTreeOps
  3. type ThisType = Parse

    Permalink

    The type of the operation being configured by this instance

    The type of the operation being configured by this instance

    Definition Classes
    ParseOperationConfigBuilder

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. val config: OperationConfig

    Permalink

    The configuration to use for all input operations.

    The configuration to use for all input operations.

    Definition Classes
    ParseInputTreeOpsOperationConfigBuilder
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. val fileSuffixes: Set[String]

    Permalink

    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.

  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def fromDefaultDirectory(exclude: FileFilter = hiddenFileFilter)(implicit codec: Codec): InputTreeResult

    Permalink

    Returns the result obtained by parsing files from the current working directory.

    Returns the result obtained by parsing files from the current working directory.

    exclude

    the files to exclude from processing

    codec

    the character encoding of the files, if not specified the platform default will be used.

    Definition Classes
    InputTreeOps
  12. def fromDirectories(roots: Seq[File], exclude: FileFilter)(implicit codec: Codec): InputTreeResult

    Permalink

    Returns the result obtained by parsing files from the specified directories and its subdirectories, merging them into a tree with a single root.

    Returns the result obtained by parsing files from the specified directories and its subdirectories, merging them into a tree with a single root.

    roots

    the root directories to traverse

    exclude

    the files to exclude from processing

    codec

    the character encoding of the files, if not specified the platform default will be used.

    Definition Classes
    InputTreeOps
  13. def fromDirectories(roots: Seq[File])(implicit codec: Codec): InputTreeResult

    Permalink

    Returns the result obtained by parsing files from the specified directories and its subdirectories, merging them into a tree with a single root.

    Returns the result obtained by parsing files from the specified directories and its subdirectories, merging them into a tree with a single root.

    roots

    the root directories to traverse

    codec

    the character encoding of the files, if not specified the platform default will be used.

    Definition Classes
    InputTreeOps
  14. def fromDirectory(dir: File, exclude: FileFilter)(implicit codec: Codec): InputTreeResult

    Permalink

    Returns the result obtained by parsing files from the specified directory and its subdirectories.

    Returns the result obtained by parsing files from the specified directory and its subdirectories.

    dir

    the root directory to traverse

    exclude

    the files to exclude from processing

    codec

    the character encoding of the files, if not specified the platform default will be used.

    Definition Classes
    InputTreeOps
  15. def fromDirectory(dir: File)(implicit codec: Codec): InputTreeResult

    Permalink

    Returns the result obtained by parsing files from the specified directory and its subdirectories.

    Returns the result obtained by parsing files from the specified directory and its subdirectories.

    dir

    the root directory to traverse

    codec

    the character encoding of the files, if not specified the platform default will be used.

    Definition Classes
    InputTreeOps
  16. def fromDirectory(name: String, exclude: FileFilter)(implicit codec: Codec): InputTreeResult

    Permalink

    Returns the result obtained by parsing files from the specified directory and its subdirectories.

    Returns the result obtained by parsing files from the specified directory and its subdirectories.

    name

    the name of the directory to traverse

    exclude

    the files to exclude from processing

    codec

    the character encoding of the files, if not specified the platform default will be used.

    Definition Classes
    InputTreeOps
  17. def fromDirectory(name: String)(implicit codec: Codec): InputTreeResult

    Permalink

    Returns the result obtained by parsing files from the specified directory and its subdirectories.

    Returns the result obtained by parsing files from the specified directory and its subdirectories.

    name

    the name of the directory to traverse

    codec

    the character encoding of the files, if not specified the platform default will be used.

    Definition Classes
    InputTreeOps
  18. def fromFile(file: File)(implicit codec: Codec): InputResult

    Permalink

    Returns the result from parsing the specified file.

    Returns the result from parsing the specified file. Any kind of character input is valid, including empty files.

    file

    the file to use as input

    codec

    the character encoding of the file, if not specified the platform default will be used.

    Definition Classes
    InputOps
  19. def fromFile(name: String)(implicit codec: Codec): InputResult

    Permalink

    Returns the result from parsing the file with the specified name.

    Returns the result from parsing the file with the specified name. Any kind of character input is valid, including empty files.

    name

    the name of the file to parse

    codec

    the character encoding of the file, if not specified the platform default will be used.

    Definition Classes
    InputOps
  20. def fromInput(input: Input): Document

    Permalink

    Returns the result from parsing the specified input.

    Returns the result from parsing the specified input.

    This is a generic method based on Laika's IO abstraction layer that concrete methods delegate to. Usually not used directly in application code, but might come in handy for very special requirements.

    input

    the input for the parser

    Definition Classes
    ParseInputOps
  21. def fromInputTree(inputTree: InputTree): DocumentTree

    Permalink

    Returns the result obtained by parsing files from the specified input tree.

    Returns the result obtained by parsing files from the specified input tree.

    inputTree

    the input tree to process

    Definition Classes
    ParseInputTreeOps
  22. def fromInputTree(builder: InputTreeBuilder): InputTreeResult

    Permalink

    Returns the result obtained by parsing files from the specified input tree builder.

    Returns the result obtained by parsing files from the specified input tree builder.

    builder

    a builder for the input tree to process

    Definition Classes
    InputTreeOps
  23. def fromReader(reader: Reader): InputResult

    Permalink

    Returns the result from parsing the input from the specified reader.

    Returns the result from parsing the input from the specified reader.

    Definition Classes
    InputOps
  24. def fromStream(stream: InputStream)(implicit codec: Codec): InputResult

    Permalink

    Returns the result from parsing the input from the specified stream.

    Returns the result from parsing the input from the specified stream.

    stream

    the stream to use as input for the parser

    codec

    the character encoding of the stream, if not specified the platform default will be used.

    Definition Classes
    InputOps
  25. def fromString(str: String): InputResult

    Permalink

    Returns the result from parsing a the specified string.

    Returns the result from parsing a the specified string. Any kind of input is valid, including an empty string.

    Definition Classes
    InputOps
  26. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  28. def inParallel(parallelism: Int, threshold: Int): ThisType

    Permalink

    Instructs the parser and/or renderer to process all inputs and outputs in parallel, with the specified level of parallelism.

    Instructs the parser and/or renderer to process all inputs and outputs in parallel, with the specified level of parallelism.

    The recursive structure of document trees will be flattened before parsing and rendering and then get reassembled afterwards, therefore the parallel processing includes all subtrees of the document tree.

    The actual transformation is a three phase process, the first (parsing) and third (rendering) can run in parallel. The second phase in the middle cannot, as this is the document tree model rewrite step where things like cross references or table of contents get processed that need access to more than just the current document.

    parallelism

    the number of batches to be executed in parallel, 1 means sequential execution

    threshold

    the minimum number of operations required for parallel execution

    Definition Classes
    OperationConfigBuilder
  29. def inParallel: ThisType

    Permalink

    Instructs the parser and/or renderer to process all inputs and outputs in parallel, with the default level of parallelism which corresponds to the number of CPUs.

    Instructs the parser and/or renderer to process all inputs and outputs in parallel, with the default level of parallelism which corresponds to the number of CPUs.

    The recursive structure of document trees will be flattened before parsing and rendering and then get reassembled afterwards, therefore the parallel processing includes all subtrees of the document tree.

    The actual transformation is a three phase process, the first (parsing) and third (rendering) can run in parallel. The second phase in the middle cannot, as this is the document tree model rewrite step where things like cross references or table of contents get processed that need access to more than just the current document.

    Definition Classes
    OperationConfigBuilder
  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. def or(parser: MarkupParser): Parse

    Permalink

    Returns a new Parse instance adding the specified parser factory.

    Returns a new Parse instance adding the specified parser factory. This factory is usually an object provided by the library or a plugin that is capable of parsing a specific markup format like Markdown or reStructuredText.

    This method is useful if you want to combine different markup formats within a single document tree.

    parser

    the parser factory to add to the previously specified parsers

  35. def strict: ThisType

    Permalink

    Turns strict mode on for the target parser, switching off any features not part of the original markup syntax.

    Turns strict mode on for the target parser, switching off any features not part of the original markup syntax. This includes the registration of directives (custom tags), custom templates with directives, as well as configuration sections at the start of the document.

    Technically it removes all ExtensionBundle instances which do not have the useInStrictMode flag set to true.

    Definition Classes
    ParseConfigBuilder
  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  37. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  38. def using(bundles: ExtensionBundle*): ThisType

    Permalink

    Returns a new instance with the specified extension bundles installed.

    Returns a new instance with the specified extension bundles installed. Features in the new bundles may override features in already installed bundles.

    Bundles are usually provided by libraries (by Laika itself or a 3rd-party extension library) or as re-usable building blocks by application code.

    Definition Classes
    OperationConfigBuilder
  39. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. def withConfig(newConfig: OperationConfig): ThisType

    Permalink

    Returns a new instance with the specified configuration.

    Returns a new instance with the specified configuration.

    This method discards any previously specified options. It is usually meant to be used when copying over the configuration from a fully configured object to an unconfigured one.

    Definition Classes
    ParseOperationConfigBuilder
  43. def withRawContent: ThisType

    Permalink

    Enables all extensions that process raw content embedded into the host markup language.

    Enables all extensions that process raw content embedded into the host markup language. These are disabled by default as Laika is designed to render to multiple output formats from a single input document. With raw content embedded the markup document is tied to a specific output format.

    Technically it activates all ExtensionBundle instances which have the acceptRawContent flag set to true.

    Definition Classes
    ParseConfigBuilder
  44. def withoutRewrite: Parse

    Permalink

    Returns a new Parse instance that produces raw document trees without applying the default rewrite rules.

    Returns a new Parse instance that produces raw document trees without applying the default rewrite rules. These rules resolve link and image references and rearrange the tree into a hierarchy of sections based on the (flat) sequence of header instances found in the document.

Inherited from InputTreeOps

Inherited from InputOps

Inherited from ParseConfigBuilder

Inherited from OperationConfigBuilder

Inherited from AnyRef

Inherited from Any

Ungrouped