ReplaceInContent Class
Replaces a search string in the content of each input document with new content.
Namespace
Statiq.Core
Interfaces
Base Types
graph BT Type-->Base0["ParallelConfigModule<string>"] 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["ReplaceInContent"] class Type type-node

Syntax

public class ReplaceInContent : ParallelConfigModule<string>, IModule, IParallelModule

Constructors

Name Summary
ReplaceInContent(string, Config<string>) Replaces all occurrences of the search string in every input document with the string value of the returned object. This allows you to specify different content for each document depending on the input document.
ReplaceInContent(string, Func<Match, IDocument, string>) Replaces all occurrences of the search string in every input document with the string value of the objects returned by the delegate. The delegate will be called for each Match in the supplied regular expression.
ReplaceInContent(string, Func<Match, string>) Replaces all occurrences of the search string in every input document with the string value of the objects returned by the delegate. The delegate will be called for each Match in the supplied regular expression.

Methods

Name Return Value Summary
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
ExecuteConfigAsync(IDocument, IExecutionContext, string) Task<IEnumerable<IDocument>>
Executes the module for each input document in parallel. If there aren't any input documents and the config delegate doesn't require documents, this will be called once with a null input.
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
IsRegex(RegexOptions) ReplaceInContent
Indicates that the search string(s) should be treated as a regular expression(s) with the specified options.

Extension Methods