Headings Class

Summary

Queries HTML content of the input documents and adds a metadata value that contains it's headings.
Assembly
Wyam.Html.dll
Namespace
Wyam.Html
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IModule"] click Interface0 "/api/Wyam.Common.Modules/IModule" Type["Headings"] class Type type-node

Syntax

public class Headings : IModule

Remarks

A new document is created for each heading, all of which are placed into a IReadOnlyList<IDocument> in the metadata of each input document. The new heading documents contain metadata with the level of the heading, the children of the heading (the following headings with one deeper level) and optionally the heading content, which is also set as the content of each document. The output of this module is the input documents with the additional metadata value containing the documents that present each heading.

Constructors

Name Summary
Headings()
Headings(int)

Methods

Name Value Summary
Execute(IReadOnlyList<IDocument>, IExecutionContext) IEnumerable<IDocument>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
WithChildrenKey(string) Headings
Sets the key to use in the heading documents to store the children of a given heading. In other words, the metadata for this key will contain all the headings following the one in the document with a level one deeper than the current heading.
WithHeadingKey(string) Headings
Sets the key to use for storing the heading content in the heading documents. The default is null which means only store the heading content in the content of the heading document. Setting this can be useful when you want to use the heading documents in downstream modules, setting their content to something else while maintaining the heading content in metadata.
WithIdKey(string) Headings
Sets the key to use in the heading documents to store the heading id attribute (if it has one).
WithLevel(int) Headings
Sets the deepest heading level to get. The default is to only query for top-level headings (level 1).
WithLevelKey(string) Headings
Sets the key to use in the heading documents to store the level.
WithMetadataKey(string) Headings
Allows you to specify an alternate metadata key for the heading documents.
WithNesting(bool) Headings
Controls whether the heading documents are nested. If nesting is used, only the level 1 headings will be in the root set of documents. The rest of the heading documents will only be accessible via the metadata of the root heading documents.
WithParentKey(string) Headings
Sets the key to use in the heading documents to store the parent of a given heading.
GitHub