OfficeIMO

API Reference

Class

MarkdownBodyRenderContext

Namespace OfficeIMO.Markdown
Assembly OfficeIMO.Markdown
Modifiers sealed

Context available while rendering a markdown document body to HTML.

Inheritance

  • Object
  • MarkdownBodyRenderContext

Methods

public IReadOnlyList<Entry> BuildTocEntries(Int32 blockIndex, TocOptions options, String titleAnchor = null) #
Returns: IReadOnlyList<Entry>

Builds TOC-style heading entries relative to a specific top-level block index using the supplied TOC options.

Parameters

blockIndex System.Int32 requiredposition: 0
options OfficeIMO.Markdown.TocOptions requiredposition: 1
titleAnchor System.String = null optionalposition: 2
public Int32 GetBlockIndex(IMarkdownBlock block) #
Returns: Int32

Returns the zero-based index of a top-level block in Blocks, or -1 when the block is not present.

Parameters

block OfficeIMO.Markdown.IMarkdownBlock requiredposition: 0
public String GetHeadingAnchor(IMarkdownBlock heading) #
Returns: String

Returns the resolved anchor id for a heading block within the current rendered body.

Parameters

heading OfficeIMO.Markdown.IMarkdownBlock requiredposition: 0
public String GetPrecedingHeadingAnchor(Int32 blockIndex, TocOptions options) #
Returns: String

Returns the anchor id of the nearest preceding heading according to the supplied TOC options, or null when no heading title should be associated with the specified block index.

Parameters

blockIndex System.Int32 requiredposition: 0
options OfficeIMO.Markdown.TocOptions requiredposition: 1

Properties

public IReadOnlyList<IMarkdownBlock> Blocks { get; } #

Top-level blocks being rendered for the current body.

public HtmlOptions Options { get; } #

Active HTML rendering options.