Queries HTML content of the input documents and adds a metadata value that contains it's headings.
- Namespace
- Statiq
.Core - Interfaces
- Base Types
-
- object
- Module
- ParallelConfigModule
<int>
graph BT
Type-->Base0["ParallelConfigModule<int>"]
Base0-->Base1["Module"]
click Base1 "/api/Statiq.Common/Module"
Base1-->Base2["object"]
Type-.->Interface0["IModule"]
click Interface0 "/api/Statiq.Common/IModule"
Type-.->Interface1["IParallelModule"]
click Interface1 "/api/Statiq.Common/IParallelModule"
Type["GatherHeadings"]
class Type type-node
Syntax
public class GatherHeadings : ParallelConfigModule<int>, IModule, IParallelModule
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 |
---|---|
GatherHeadings |
|
GatherHeadings |
Methods
Name | Return Value | Summary |
---|---|---|
AfterExecution |
void |
Called after each module execution.
Inherited from Module
|
AfterExecutionAsync |
Task |
Called after each module execution.
Inherited from Module
|
BeforeExecution |
void |
Called before each module execution.
Inherited from Module
|
BeforeExecutionAsync |
Task |
Called before each module execution.
Inherited from Module
|
ExecuteAsync |
Task |
This should not be called directly, instead call
IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
|
ExecuteConfigAsync |
Task |
|
Finally |
void |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
FinallyAsync |
Task |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
GetHeadingQuery |
string |
static
|
WithChildrenKey |
GatherHeadings |
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 |
GatherHeadings |
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 |
GatherHeadings |
Sets the key to use in the heading documents to store the heading
id attribute (if it has one).
|
WithLevelKey |
GatherHeadings |
Sets the key to use in the heading documents to store the level.
|
WithMetadataKey |
GatherHeadings |
Allows you to specify an alternate metadata key for the heading documents.
|
WithNestedElements |
GatherHeadings |
Includes nested HTML elements in the heading content (the default is
false ).
|
WithNesting |
GatherHeadings |
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.
|