Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

MarkdownRendererPlugin

OfficeIMO.MarkdownRenderer

Namespace
OfficeIMO.MarkdownRenderer
Assembly
OfficeIMO.MarkdownRenderer
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

Reusable fenced-block renderer plugin that can register one or more renderer extensions on top of Markdown and the host HTML shell.

Inheritance

  • object
  • MarkdownRendererPlugin

Usage

Explore 13 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 8

Constructors

MarkdownRendererPlugin 2 overloads
public MarkdownRendererPlugin(string name, IEnumerable<Func<MarkdownFencedCodeBlockRenderer>> rendererFactories, IEnumerable<MarkdownFenceOptionSchema>? fenceOptionSchemas = null, IEnumerable<IMarkdownDocumentTransform>? readerDocumentTransforms = null, IEnumerable<IMarkdownDocumentTransform>? htmlDocumentTransforms = null, IEnumerable<MarkdownHtmlBlockConverter>? htmlElementBlockConverters = null, IEnumerable<MarkdownHtmlInlineConverter>? htmlInlineElementConverters = null, IEnumerable<MarkdownVisualElementRoundTripHint>? visualElementRoundTripHints = null, IEnumerable<IMarkdownDocumentTransform>? rendererDocumentTransforms = null, Action<MarkdownRendererOptions>? apply = null, Action<MarkdownLoadOptions>? applyReader = null) #

Creates a plugin from one or more fenced-block renderer factories.

Parameters

name string required
rendererFactories System.Collections.Generic.IEnumerable<System.Func<OfficeIMO.MarkdownRenderer.MarkdownFencedCodeBlockRenderer>> required
fenceOptionSchemas System.Collections.Generic.IEnumerable<OfficeIMO.MarkdownRenderer.MarkdownFenceOptionSchema>? = null optional
readerDocumentTransforms System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.IMarkdownDocumentTransform>? = null optional
htmlDocumentTransforms System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.IMarkdownDocumentTransform>? = null optional
htmlElementBlockConverters System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.Html.MarkdownHtmlBlockConverter>? = null optional
htmlInlineElementConverters System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.Html.MarkdownHtmlInlineConverter>? = null optional
visualElementRoundTripHints System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.MarkdownVisualElementRoundTripHint>? = null optional
rendererDocumentTransforms System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.IMarkdownDocumentTransform>? = null optional
apply System.Action<OfficeIMO.MarkdownRenderer.MarkdownRendererOptions>? = null optional
applyReader System.Action<OfficeIMO.Markdown.MarkdownLoadOptions>? = null optional
public MarkdownRendererPlugin(string name, IEnumerable<MarkdownRendererPlugin> plugins, IEnumerable<MarkdownFenceOptionSchema>? fenceOptionSchemas = null, IEnumerable<IMarkdownDocumentTransform>? readerDocumentTransforms = null, IEnumerable<IMarkdownDocumentTransform>? htmlDocumentTransforms = null, IEnumerable<MarkdownHtmlBlockConverter>? htmlElementBlockConverters = null, IEnumerable<MarkdownHtmlInlineConverter>? htmlInlineElementConverters = null, IEnumerable<MarkdownVisualElementRoundTripHint>? visualElementRoundTripHints = null, IEnumerable<IMarkdownDocumentTransform>? rendererDocumentTransforms = null, Action<MarkdownRendererOptions>? apply = null, Action<MarkdownLoadOptions>? applyReader = null) #

Creates a plugin by composing one or more existing plugins and optional extra schemas.

Parameters

name string required
plugins System.Collections.Generic.IEnumerable<OfficeIMO.MarkdownRenderer.MarkdownRendererPlugin> required
fenceOptionSchemas System.Collections.Generic.IEnumerable<OfficeIMO.MarkdownRenderer.MarkdownFenceOptionSchema>? = null optional
readerDocumentTransforms System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.IMarkdownDocumentTransform>? = null optional
htmlDocumentTransforms System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.IMarkdownDocumentTransform>? = null optional
htmlElementBlockConverters System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.Html.MarkdownHtmlBlockConverter>? = null optional
htmlInlineElementConverters System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.Html.MarkdownHtmlInlineConverter>? = null optional
visualElementRoundTripHints System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.MarkdownVisualElementRoundTripHint>? = null optional
rendererDocumentTransforms System.Collections.Generic.IEnumerable<OfficeIMO.Markdown.IMarkdownDocumentTransform>? = null optional
apply System.Action<OfficeIMO.MarkdownRenderer.MarkdownRendererOptions>? = null optional
applyReader System.Action<OfficeIMO.Markdown.MarkdownLoadOptions>? = null optional

Methods

public void Apply(MarkdownRendererOptions options) #

Applies the plugin to the supplied renderer options without duplicating existing language registrations.

Parameters

options OfficeIMO.MarkdownRenderer.MarkdownRendererOptions required
public bool IsApplied(MarkdownRendererOptions options) #

Returns true when any of this plugin's fenced block languages are already registered.

Parameters

options OfficeIMO.MarkdownRenderer.MarkdownRendererOptions required

Returns

bool

Properties

public string Name { get; } #

Friendly plugin name used for diagnostics and documentation.

public string Id { get; } #

Stable plugin identifier used for idempotence and diagnostics.

public IReadOnlyList<string> Languages { get; } #

All fenced block languages covered by this plugin.

public IReadOnlyList<MarkdownFenceOptionSchema> FenceOptionSchemas { get; } #

Fence option schemas contributed by this plugin.

public IReadOnlyList<IMarkdownDocumentTransform> ReaderDocumentTransforms { get; } #

Reader-side document transforms contributed by this plugin. Hosts can register these on MarkdownLoadOptions.DocumentTransforms when they want source parsing aligned with the plugin contract.

public IReadOnlyList<IMarkdownDocumentTransform> HtmlDocumentTransforms { get; } #

HTML-to-markdown document transforms contributed by this plugin. Hosts can register these on HtmlMarkdownExportOptions.DocumentTransforms when they want HTML ingestion aligned with the plugin contract.

public IReadOnlyList<IMarkdownDocumentTransform> RendererDocumentTransforms { get; } #

Renderer-side document transforms contributed by this plugin. Hosts can register these on MarkdownRendererOptions.DocumentTransforms when they want renderer-time AST rewrites aligned with the plugin contract.

public IReadOnlyList<MarkdownHtmlBlockConverter> HtmlElementBlockConverters { get; } #

HTML-to-markdown custom element block converters contributed by this plugin. Hosts can register these on HtmlMarkdownExportOptions.ElementBlockConverters when they want HTML element decoding aligned with the plugin contract.

public IReadOnlyList<MarkdownHtmlInlineConverter> HtmlInlineElementConverters { get; } #

HTML-to-markdown custom inline element converters contributed by this plugin. Hosts can register these on HtmlMarkdownExportOptions.InlineElementConverters when they want inline HTML decoding aligned with the plugin contract.

public IReadOnlyList<MarkdownVisualElementRoundTripHint> VisualElementRoundTripHints { get; } #

Shared visual-host HTML round-trip hints contributed by this plugin. Hosts can register these on HtmlMarkdownExportOptions.VisualElementRoundTripHints when they want HTML-to-AST recovery aligned with the plugin contract.