Yaml Wyam.Yaml

Parses YAML content for each input document and stores the result in it's metadata.
Parses the content for each input document and then stores a dynamic object representing the first YAML document in metadata with the specified key. If no key is specified, then the dynamic object is not added. You can also flatten the YAML to add top-level pairs directly to the document metadata.

Package

This module exists in the Wyam.Yaml package which is not part of the core distribution. Add the following preprocessor directive to your configuration file to use it:
#n Wyam.Yaml
Alternativly, you can add all modules at once with the following preprocessor directive:
#n Wyam.All

Usage

  • Yaml()

    The content of the input document is parsed as YAML. All root-level scalars are added to the input document's metadata. Any more complex YAML structures are ignored. This is best for simple key-value YAML documents.

  • Yaml(string key, bool flatten = false)

    The content of the input document is parsed as YAML. A dynamic object representing the first YAML document is set as the value for the given metadata key. See YamlDotNet.Dynamic for more details about the dynamic YAML object. If flatten is true, all root-level scalars are also added to the input document's metadata.

    • key

      The metadata key in which to set the dynamic YAML object.

    • flatten

      If set to true, all root-level scalars are also added to the input document's metadata.

GitHub