IShortcode.

Execute(KeyValuePair<string, string>[], string, IDocument, IExecutionContext) Method

Summary

Executes the shortcode and returns an Wyam.Common.Shortcodes.IShortcodeResult.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Shortcodes
Containing Type
IShortcode

Syntax

IShortcodeResult Execute(KeyValuePair<string, string>[] args, string content, IDocument document, IExecutionContext context)

Parameters

Name Type Description
args KeyValuePair<string, string>[] The arguments declared with the shortcode. This contains a list of key-value pairs in the order they appeared in the shortcode declaration. If no key was specified, then the System.Collections.Generic.KeyValuePair`2.Key property will be null.
content string The content of the shortcode.
document IDocument The current document (including metadata from previous shortcodes in the same document).
context IExecutionContext The current execution context. This can be used to obtain the Wyam.Common.Shortcodes.IShortcodeResult instance by calling Wyam.Common.Execution.IExecutionContext.GetShortcodeResult(System.IO.Stream,System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,System.Object}}).

Return Value

Type Description
IShortcodeResult A shortcode result that contains a stream and new metadata as a result of executing this shortcode. The result can be null in which case the shortcode declaration will be removed from the document but no replacement content will be added and the metadata will not change.
GitHub