This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy at the same URL with .md appended. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

PackageVersionShortcode Pennington.Markdown.Shortcodes

Built-in shortcode that emits Pennington's published package version, dispatched by the name PackageVersion. Resolves the Pennington core assembly's AssemblyInformationalVersionAttribute and trims MinVer's +<sha> build metadata, so it matches the NuGet version a reader installs. Unlike the Version shortcode (which reads the host's entry assembly), this always reports Pennington itself — the value to stamp into install snippets. Takes no arguments.

Properties

Name string
Case-insensitive name used to dispatch <?# Name ... ?> invocations.

Methods

ExecuteAsync

#
public Task<string> ExecuteAsync(ShortcodeInvocation invocation, ShortcodeContext context, CancellationToken cancellationToken)

Produces the replacement text for one invocation. invocation carries the parsed arguments and inline content (null for self-closing tags); context carries the host page's route and metadata.

Parameters

invocation ShortcodeInvocation
context ShortcodeContext
cancellationToken CancellationToken

Returns

Task<string>

Pennington.Markdown.Shortcodes.PackageVersionShortcode

namespace Pennington.Markdown.Shortcodes;

/// Built-in shortcode that emits Pennington's published package version, dispatched by the name PackageVersion. Resolves the Pennington core assembly's AssemblyInformationalVersionAttribute and trims MinVer's +<sha> build metadata, so it matches the NuGet version a reader installs. Unlike the Version shortcode (which reads the host's entry assembly), this always reports Pennington itself — the value to stamp into install snippets. Takes no arguments.
public class PackageVersionShortcode
{
    /// Produces the replacement text for one invocation. invocation carries the parsed arguments and inline content (null for self-closing tags); context carries the host page's route and metadata.
    
public Task<string> ExecuteAsync(ShortcodeInvocation invocation, ShortcodeContext context, CancellationToken cancellationToken)
; /// Case-insensitive name used to dispatch <?# Name ... ?> invocations.
public string Name { get; }
}