ShortcodeArgsExtensions Class
Namespace
Statiq.Common
Base Types
  • object
graph BT Type-->Base0["object"] Type["ShortcodeArgsExtensions"] class Type type-node

Syntax

public static class ShortcodeArgsExtensions

Methods

Name Return Value Summary
SingleValue(KeyValuePair<string, string>[]) string
Validates that the arguments contain a single value and returns it. This will collapse keys and values into a single argument value so that "=" doesn't have to be escaped with quotes.
static
ToDictionary(KeyValuePair<string, string>[], string[]) IMetadataDictionary
Converts the shortcode arguments into a dictionary of named parameters. This will match un-named positional parameters with their expected position after which named parameters will be included. If an un-named positional parameter follows named parameters an exception will be thrown.
static
ToValueArray(IEnumerable<KeyValuePair<string, string>>) string[]
Returns arguments as an array. This will collapse keys and values into a single argument value so that "=" doesn't have to be escaped with quotes.
static
ToValueArray(KeyValuePair<string, string>[], int, int) string[]
Validates that the correct number of arguments have been used and returns them as an array. This will collapse keys and values into a single argument value so that "=" doesn't have to be escaped with quotes.
static
ToValueArray(KeyValuePair<string, string>[], int) string[]
Validates that the correct number of unnamed arguments have been used and returns them as an array. This will collapse keys and values into a single argument value so that "=" doesn't have to be escaped with quotes.
static