Extracts the first part of content for each document and sends it to a child module for processing.
- Namespace
- Statiq
.Core - Interfaces
- Base Types
-
- object
- Module
- ParentModule
graph BT
Type-->Base0["ParentModule"]
click Base0 "/api/Statiq.Common/ParentModule"
Base0-->Base1["Module"]
click Base1 "/api/Statiq.Common/Module"
Base1-->Base2["object"]
Type-.->Interface0["IModule"]
click Interface0 "/api/Statiq.Common/IModule"
Type-.->Interface1["IEnumerable<IModule>"]
Type-.->Interface2["IEnumerable"]
Type["ExtractFrontMatter"]
class Type type-node
Syntax
public class ExtractFrontMatter : ParentModule, IModule, IEnumerable<IModule>, IEnumerable
Remarks
This module is typically used in conjunction with the Yaml module to enable putting YAML front
matter in a file. First, the content of each input document is scanned for a line that consists
entirely of the delimiter character or (- by default) or the delimiter string. Once found, the
content before the delimiter is passed to the specified child modules. Any metadata from the child
module output document(s) is added to the input document. Note that if the child modules result
in more than one output document, multiple clones of the input document will be made for each one.
The output document content is set to the original content without the front matter.
Constructors
Name | Summary |
---|---|
ExtractFrontMatter |
Uses the specified delimiter character and passes any front matter to the specified child modules for processing. |
ExtractFrontMatter |
Identifies front matter using one or more regular expressions and passes any front matter to the specified child modules for processing. |
ExtractFrontMatter |
Identifies front matter using one or more regular expressions and passes any front matter to the specified child modules for processing. |
ExtractFrontMatter |
Uses the default delimiter character and passes any front matter to the specified child modules for processing. |
ExtractFrontMatter |
Uses the specified delimiter string and passes any front matter to the specified child modules for processing. |
Properties
Name | Property Type | Summary |
---|---|---|
Children | ModuleList |
The children of this module.
Inherited from ParentModule
|
Methods
Name | Return Value | Summary |
---|---|---|
Add |
void |
Adds modules as a child of this module.
Inherited from ParentModule
|
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
|
ExecuteContextAsync |
Task |
|
ExecuteInputAsync |
Task |
Executes the module.
Inherited from Module
|
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
|
GetDelimiterRegex |
string |
Gets a regex pattern for front matter using the specified delimiters.
static
|
GetDelimiterRegex |
string |
Gets a regex pattern for front matter using the specified delimiters.
static
|
GetEnumerator |
IEnumerator |
Inherited from ParentModule
|
Ignore |
ExtractFrontMatter |
Ignores the delimiter if it appears on the first line. This is useful when processing Jekyll style front matter that
has the delimiter both above and below the front matter content. The default behavior is
true .
This setting has no effect if a start delimiter is required.
|
PreserveFrontMatter |
ExtractFrontMatter |
By default the front matter is removed from the source file. This allows you to preserve
it in the file for further processing.
|
Require |
ExtractFrontMatter |
Requires a start delimiter as the first line of the file.
|
Require |
ExtractFrontMatter |
Requires a start delimiter as the first line of the file.
|