OfficeIMO

API Reference

Class

MarkdownSyntaxNode

Namespace OfficeIMO.Markdown
Assembly OfficeIMO.Markdown
Modifiers sealed

A lightweight syntax-tree node built from the parsed markdown document.

Inheritance

  • Object
  • MarkdownSyntaxNode

Constructors

public MarkdownSyntaxNode(MarkdownSyntaxKind kind, Nullable<MarkdownSourceSpan> sourceSpan = null, String literal = null, IReadOnlyList<MarkdownSyntaxNode> children = null, Object associatedObject = null, String customKind = null) #

Create a syntax node.

Parameters

kind OfficeIMO.Markdown.MarkdownSyntaxKind requiredposition: 0
sourceSpan System.Nullable{OfficeIMO.Markdown.MarkdownSourceSpan} = null optionalposition: 1
literal System.String = null optionalposition: 2
children System.Collections.Generic.IReadOnlyList{OfficeIMO.Markdown.MarkdownSyntaxNode} = null optionalposition: 3
associatedObject System.Object = null optionalposition: 4
customKind System.String = null optionalposition: 5

Methods

public IEnumerable<MarkdownSyntaxNode> Ancestors() #
Returns: IEnumerable<MarkdownSyntaxNode>

Returns ancestor nodes from the immediate parent up to the root.

public IEnumerable<MarkdownSyntaxNode> AncestorsAndSelf() #
Returns: IEnumerable<MarkdownSyntaxNode>

Returns this node followed by its ancestors up to the root.

public IEnumerable<MarkdownSyntaxNode> Descendants() #
Returns: IEnumerable<MarkdownSyntaxNode>

Returns all descendant nodes in depth-first order, excluding this node.

public IEnumerable<MarkdownSyntaxNode> DescendantsAndSelf() #
Returns: IEnumerable<MarkdownSyntaxNode>

Returns this node and all descendant nodes in depth-first order.

public MarkdownSyntaxNode FindDeepestNodeAtLine(Int32 lineNumber) #
Returns: MarkdownSyntaxNode

Finds the deepest node whose source span contains the given 1-based line number.

Parameters

lineNumber System.Int32 requiredposition: 0
public MarkdownSyntaxNode FindDeepestNodeAtPosition(Int32 lineNumber, Int32 columnNumber) #
Returns: MarkdownSyntaxNode

Finds the deepest node whose source span contains the given 1-based line and column.

Parameters

lineNumber System.Int32 requiredposition: 0
columnNumber System.Int32 requiredposition: 1
public MarkdownSyntaxNode FindDeepestNodeContainingSpan(MarkdownSourceSpan span) #
Returns: MarkdownSyntaxNode

Finds the deepest node whose source span fully contains the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan requiredposition: 0
public MarkdownSyntaxNode FindDeepestNodeOverlappingSpan(MarkdownSourceSpan span) #
Returns: MarkdownSyntaxNode

Finds the deepest node whose source span overlaps the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan requiredposition: 0
public MarkdownSyntaxNode FindNearestBlockAtLine(Int32 lineNumber) #
Returns: MarkdownSyntaxNode

Finds the nearest block-like syntax node whose source span contains the given 1-based line number.

Parameters

lineNumber System.Int32 requiredposition: 0
public MarkdownSyntaxNode FindNearestBlockAtPosition(Int32 lineNumber, Int32 columnNumber) #
Returns: MarkdownSyntaxNode

Finds the nearest block-like syntax node whose source span contains the given 1-based line and column.

Parameters

lineNumber System.Int32 requiredposition: 0
columnNumber System.Int32 requiredposition: 1
public MarkdownSyntaxNode FindNearestBlockContainingSpan(MarkdownSourceSpan span) #
Returns: MarkdownSyntaxNode

Finds the nearest block-like syntax node whose source span fully contains the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan requiredposition: 0
public MarkdownSyntaxNode FindNearestBlockOverlappingSpan(MarkdownSourceSpan span) #
Returns: MarkdownSyntaxNode

Finds the nearest block-like syntax node whose source span overlaps the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan requiredposition: 0
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathAtLine(Int32 lineNumber) #
Returns: IReadOnlyList<MarkdownSyntaxNode>

Finds the node path from this node to the deepest node whose source span contains the given 1-based line number.

Parameters

lineNumber System.Int32 requiredposition: 0
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathAtPosition(Int32 lineNumber, Int32 columnNumber) #
Returns: IReadOnlyList<MarkdownSyntaxNode>

Finds the node path from this node to the deepest node whose source span contains the given 1-based line and column.

Parameters

lineNumber System.Int32 requiredposition: 0
columnNumber System.Int32 requiredposition: 1
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathContainingSpan(MarkdownSourceSpan span) #
Returns: IReadOnlyList<MarkdownSyntaxNode>

Finds the node path from this node to the deepest node whose source span fully contains the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan requiredposition: 0
public IReadOnlyList<MarkdownSyntaxNode> FindNodePathOverlappingSpan(MarkdownSourceSpan span) #
Returns: IReadOnlyList<MarkdownSyntaxNode>

Finds the node path from this node to the deepest node whose source span overlaps the given span.

Parameters

span OfficeIMO.Markdown.MarkdownSourceSpan requiredposition: 0

Properties

public MarkdownSyntaxKind Kind { get; } #

Node kind.

public Nullable<MarkdownSourceSpan> SourceSpan { get; } #

Optional source span from the original markdown.

public String Literal { get; } #

Optional literal payload for leaf-like nodes.

public String CustomKind { get; } #

Optional custom extension kind for nodes emitted by syntax-aware extensions.

public Object AssociatedObject { get; } #

Optional originating model object (document/block/inline) for AST-aware consumers.

public MarkdownSyntaxNode Parent { get; set; } #

Parent syntax node when this node belongs to a larger syntax tree.

public IReadOnlyList<MarkdownSyntaxNode> Children { get; } #

Child syntax nodes.

public Int32 IndexInParent { get; } #

Zero-based child index within Parent when available.

public MarkdownSyntaxNode PreviousSibling { get; } #

Nearest previous sibling node when present.

public MarkdownSyntaxNode NextSibling { get; } #

Nearest next sibling node when present.

public MarkdownSyntaxNode Root { get; } #

Document root for this node.