Documents Class

Summary

Inserts documents into the current pipeline.
Assembly
Wyam.Core.dll
Namespace
Wyam.Core.Modules.Control
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IModule"] click Interface0 "/api/Wyam.Common.Modules/IModule" Type["Documents"] class Type type-node

Syntax

public class Documents : IModule

Remarks

Documents can be inserted either by replacing pipeline documents with previously processed ones or by creating new ones. If getting previously processed documents from another pipeline, this module copies the documents and places them into the current pipeline. Note that because this module does not remove the documents from their original pipeline it's likely you will end up with documents that have the same content and metadata in two different pipelines. This module does not include the input documents as part of it's output. If you want to concatenate the result of this module with the input documents, wrap it with the Wyam.Core.Modules.Control.Concat module.

Constructors

Name Summary
Documents() This outputs all existing documents from all pipelines (except the current one).
Documents(ContextConfig) This will get documents based on the context so you can perform custom document fetching behavior. The delegate will only be called once, regardless of the number of input documents. The return value is expected to be a IEnumerable<IDocument>.
Documents(DocumentConfig) This will get documents based on each input document. The output will be the aggregate of all returned documents for each input document. The return value is expected to be a IEnumerable<IDocument>.
Documents(IEnumerable<KeyValuePair<string, Object>>[]) Generates new documents with the specified metadata.
Documents(int) Generates a specified number of new empty documents.
Documents(string) This outputs the documents from the specified pipeline.
Documents(string[]) Generates new documents with the specified content.
Documents(Tuple<string, IEnumerable<KeyValuePair<string, Object>>>[]) Generates new documents with the specified content and metadata.

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.
FromPipelines(string[]) Documents
Gets documents from additional pipeline(s). The final sequence of documents will be in the order they appear from all specified pipelines. If the empty constructor is used that outputs documents from all pipelines, this will override that behavior and only output the specified pipelines. Likewise, if another constructor was used that relies on a Wyam.Common.Configuration.ContextConfig or Wyam.Common.Configuration.DocumentConfig then using this method will throw System.InvalidOperationException.
Where(DocumentConfig) Documents
Only documents that satisfy the predicate will be output.
GitHub