Execute Class

Summary

Executes custom code that returns documents, modules, or new content.
Assembly
Wyam.Core.dll
Namespace
Wyam.Core.Modules.Extensibility
Interfaces
Base Types
  • Object
graph TD Base0["Object"]-->Type Interface0["IModule"]-.->Type click Interface0 "/api/Wyam.Common.Modules/IModule" Type["Execute"] class Type type-node

Syntax

public class Execute : IModule

Remarks

This module is very useful for customizing pipeline execution without having to write an entire module. Returning modules from the delegate is also useful for customizing existing modules based on the current set of documents. For example, you can use this module to execute the Wyam.Core.Modules.Contents.Replace module with customized search strings based on the results of other pipelines.

Constructors

Name Summary
Execute(Action<IDocument, IExecutionContext>, bool) Specifies a delegate that should be invoked once for each input document. The output from this module will be the input documents.
Execute(Action<IExecutionContext>) Specifies a delegate that should be invoked once for all input documents. The output from this module will be the input documents.
Execute(ContextConfig) Specifies a delegate that should be invoked once for all input documents. If the delegate returns a IEnumerable<IDocument> or Wyam.Common.Documents.IDocument, the document(s) will be the output(s) of this module. If the delegate returns a IEnumerable<IModule> or Wyam.Common.Modules.IModule, the module(s) will be executed with the input documents as their input and the results will be the output of this module. If the delegate returns null, this module will just output the input documents. If anything else is returned, an exception will be thrown.
Execute(DocumentConfig, bool) Specifies a delegate that should be invoked once for each input document. If the delegate returns a IEnumerable<IDocument> or Wyam.Common.Documents.IDocument, the document(s) will be the output(s) of this module. If the delegate returns a IEnumerable<IModule> or Wyam.Common.Modules.IModule, the module(s) will be executed with each input document as their input and the results will be the output of this module. If the delegate returns null, this module will just output the input document. If anything else is returned, the input document will be output with the string value of the delegate result as it's content.
Execute(Func<IReadOnlyList<IDocument>, IExecutionContext, Object, Object>) Specifies a delegate that should be invoked for all input documents. If the delegate returns a IEnumerable<IDocument> or Wyam.Common.Documents.IDocument, the document(s) will be the output(s) of this module. If the delegate returns null or anything else, this module will just output the input documents. The third parameter of the delegate is primarly to aid overload resolution between this and the other constructors. The value null will be passed for now, though it might be used for something else in a future version.
GitHub