Interface
public interface IMokaPlugin
Namespace: Moka.Docs.Plugins
Contract that all MokaDocs plugins must implement. Plugins are discovered and loaded by the PluginHost.
Properties
| Name | Description |
|---|---|
Id abstract |
Unique identifier for this plugin (e.g., "mokadocs-mermaid"). |
Name abstract |
Human-readable display name. |
Version abstract |
Semantic version of this plugin. |
Id
string IMokaPlugin.Id { get; }
Unique identifier for this plugin (e.g., "mokadocs-mermaid").
Name
string IMokaPlugin.Name { get; }
Human-readable display name.
Version
string IMokaPlugin.Version { get; }
Semantic version of this plugin.
Methods
| Name | Description |
|---|---|
ExecuteAsync(…) abstract |
Called during the build pipeline, giving the plugin a chance to modify the build context (add pages, transform content, etc.). |
InitializeAsync(IPluginContext context, CancellationToken ct) abstract |
Called once when the plugin is loaded. Use this to register services, subscribe to events, or validate configuration. |
ExecuteAsync(IPluginContext context, BuildContext buildContext, CancellationToken ct)
Task IMokaPlugin.ExecuteAsync(IPluginContext context, BuildContext buildContext, CancellationToken ct = null)
Called during the build pipeline, giving the plugin a chance to modify the build context (add pages, transform content, etc.).
Parameters
| Name | Type | Description |
|---|---|---|
context | Moka.Docs.Plugins.IPluginContext | The plugin context. |
buildContext | BuildContext | The current build context. |
ct | CancellationToken | Cancellation token. |
InitializeAsync(IPluginContext context, CancellationToken ct)
Task IMokaPlugin.InitializeAsync(IPluginContext context, CancellationToken ct = null)
Called once when the plugin is loaded. Use this to register services, subscribe to events, or validate configuration.
Parameters
| Name | Type | Description |
|---|---|---|
context | Moka.Docs.Plugins.IPluginContext | The plugin context providing access to site services. |
ct | CancellationToken | Cancellation token. |
Type Relationships
classDiagram
style IMokaPlugin fill:#f9f,stroke:#333,stroke-width:2px
BlazorPreviewPlugin ..|> IMokaPlugin : implements
ChangelogPlugin ..|> IMokaPlugin : implements
OpenApiPlugin ..|> IMokaPlugin : implements
ReplPlugin ..|> IMokaPlugin : implements
View Source
/// <summary>
/// Contract that all MokaDocs plugins must implement.
/// Plugins are discovered and loaded by the <see cref = "PluginHost"/>.
/// </summary>
public interface IMokaPlugin
{
/// <summary>
/// Unique identifier for this plugin (e.g., "mokadocs-mermaid").
/// </summary>
string Id { get; }
/// <summary>
/// Human-readable display name.
/// </summary>
string Name { get; }
/// <summary>
/// Semantic version of this plugin.
/// </summary>
string Version { get; }
/// <summary>
/// Called once when the plugin is loaded. Use this to register services,
/// subscribe to events, or validate configuration.
/// </summary>
/// <param name = "context">The plugin context providing access to site services.</param>
/// <param name = "ct">Cancellation token.</param>
Task InitializeAsync(IPluginContext context, CancellationToken ct = default);
/// <summary>
/// Called during the build pipeline, giving the plugin a chance to
/// modify the build context (add pages, transform content, etc.).
/// </summary>
/// <param name = "context">The plugin context.</param>
/// <param name = "buildContext">The current build context.</param>
/// <param name = "ct">Cancellation token.</param>
Task ExecuteAsync(IPluginContext context, BuildContext buildContext, CancellationToken ct = default);
}