ProcessSidecarFile Class
Extracts the content of a Sidecar file for each document and sends it to a child module for processing.
Namespace
Statiq.Core
Interfaces
Base Types
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["ProcessSidecarFile"] class Type type-node

Syntax

public class ProcessSidecarFile : ParentModule, IModule, IEnumerable<IModule>, IEnumerable

Remarks

This module is typically used in conjunction with the Yaml module to enable putting YAML in a Sidecar file. First, an attempt is made to find the specified sidecar file for each input document. Once found, the content in this file is passed to the specified child module(s). Any metadata from the child module output document(s) is added to the input document. Note that if the child module(s) 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 input document content.

Constructors

Name Summary
ProcessSidecarFile(Config<NormalizedPath>, IModule[]) Uses a delegate to describe where to find the sidecar file for each input document. If a sidecar file is found, it's content is passed to the specified child modules for processing.
ProcessSidecarFile(IModule[]) Searches for sidecar files at the same path as the input document Source with the additional extension .meta. If a sidecar file is found, it's content is passed to the specified child modules for processing.
ProcessSidecarFile(string, IModule[]) Searches for sidecar files at the same path as the input document Source with the specified additional extension. If a sidecar file is found, it's content is passed 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(IModule[]) void
Adds modules as a child of this module.
Inherited from ParentModule
AfterExecution(IExecutionContext, ExecutionOutputs) void
Called after each module execution.
Inherited from Module
AfterExecutionAsync(IExecutionContext, ExecutionOutputs) Task
Called after each module execution.
Inherited from Module
BeforeExecution(IExecutionContext) void
Called before each module execution.
Inherited from Module
BeforeExecutionAsync(IExecutionContext) Task
Called before each module execution.
Inherited from Module
ExecuteAsync(IExecutionContext) Task<IEnumerable<IDocument>>
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(IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module once for all input documents.
Inherited from Module
ExecuteInputAsync(IDocument, IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module.
Finally(IExecutionContext) void
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
FinallyAsync(IExecutionContext) Task
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
GetEnumerator() IEnumerator<IModule>
Inherited from ParentModule

Extension Methods

Name Value Summary
Concat<IModule>(IModule) IEnumerable<T>
ForEachDocument() ForEachDocument
GetNext<IModule>(IModule, IEqualityComparer<IModule>) T
GetNext<IModule>(IModule) T
GetPrevious<IModule>(IModule, IEqualityComparer<IModule>) T
GetPrevious<IModule>(IModule) T
GroupByMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, TElement>, IEqualityComparer<TKey>) IEnumerable<IGrouping<TKey, TElement>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
GroupByMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, TElement>) IEnumerable<IGrouping<TKey, TElement>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function.
GroupByMany<IModule, TKey>(Func<IModule, IEnumerable<TKey>>, IEqualityComparer<TKey>) IEnumerable<IGrouping<TKey, TSource>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys and compares the keys by using a specified comparer.
GroupByMany<IModule, TKey>(Func<IModule, IEnumerable<TKey>>) IEnumerable<IGrouping<TKey, TSource>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys.
GroupByManyToMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, IEnumerable<TElement>>, IEqualityComparer<TKey>) IEnumerable<IGrouping<TKey, TElement>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function that returns a sequence of elements.
GroupByManyToMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, IEnumerable<TElement>>) IEnumerable<IGrouping<TKey, TElement>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function that returns a sequence of elements.
ParallelForEachAsync<IModule>(Func<IModule, Task>, CancellationToken) Task
ParallelSelectAsync<IModule, TResult>(Func<IModule, Task<TResult>>, CancellationToken) Task<IEnumerable<TResult>>
Invokes an async selector in parallel.
ParallelSelectManyAsync<IModule, TResult>(Func<IModule, Task<IEnumerable<TResult>>>, CancellationToken) Task<IEnumerable<TResult>>
Invokes an async selector that returns multiple results in parallel.
ParallelWhereAsync<IModule>(Func<IModule, Task<bool>>, CancellationToken) Task<IEnumerable<TSource>>
StartsWith<IModule>(IEnumerable<IModule>, IEqualityComparer<IModule>) bool
Determines whether the items starts with the specified values.
StartsWith<IModule>(IEnumerable<IModule>) bool
Determines whether the items starts with the specified values.
ThrowIfNull<ProcessSidecarFile>(string) T
ToDocument<ProcessSidecarFile>(IContentProvider) IDocument
ToDocument<ProcessSidecarFile>(IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocument<ProcessSidecarFile>(NormalizedPath, IContentProvider) IDocument
ToDocument<ProcessSidecarFile>(NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocument<ProcessSidecarFile>(NormalizedPath, NormalizedPath, IContentProvider) IDocument
ToDocument<ProcessSidecarFile>(NormalizedPath, NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocuments<IModule>(Func<IModule, IContentProvider>) IEnumerable<IDocument>
ToDocuments<IModule>(Func<IModule, IEnumerable<KeyValuePair<string, object>>>, Func<IModule, IContentProvider>) IEnumerable<IDocument>
ToDocuments<IModule>(Func<IModule, NormalizedPath>, Func<IModule, IContentProvider>) IEnumerable<IDocument>
ToDocuments<IModule>(Func<IModule, NormalizedPath>, Func<IModule, IEnumerable<KeyValuePair<string, object>>>, Func<IModule, IContentProvider>) IEnumerable<IDocument>
ToDocuments<IModule>(Func<IModule, NormalizedPath>, Func<IModule, NormalizedPath>, Func<IModule, IContentProvider>) IEnumerable<IDocument>
ToDocuments<IModule>(Func<IModule, NormalizedPath>, Func<IModule, NormalizedPath>, Func<IModule, IEnumerable<KeyValuePair<string, object>>>, Func<IModule, IContentProvider>) IEnumerable<IDocument>
ToLookupMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, TElement>, IEqualityComparer<TKey>) ILookup<TKey, TElement>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
ToLookupMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, TElement>) ILookup<TKey, TElement>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function.
ToLookupMany<IModule, TKey>(Func<IModule, IEnumerable<TKey>>, IEqualityComparer<TKey>) ILookup<TKey, TSource>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys and compares the keys by using a specified comparer.
ToLookupMany<IModule, TKey>(Func<IModule, IEnumerable<TKey>>) ILookup<TKey, TSource>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys.
ToLookupManyToMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, IEnumerable<TElement>>, IEqualityComparer<TKey>) ILookup<TKey, TElement>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function that returns a sequence of elements.
ToLookupManyToMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, IEnumerable<TElement>>) ILookup<TKey, TElement>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function that returns a sequence of elements.
ToStringTable<IModule>(string[], Func<IModule, object>[]) string
WithChildren<ProcessSidecarFile>(IEnumerable<IModule>) TModule
WithChildren<ProcessSidecarFile>(IModule[]) TModule