API Reference

Cmdlet

Get-OfficeMarkdownHeading

Namespace PSWriteOffice
Inputs
OfficeIMO.Markdown.MarkdownDoc
Outputs
OfficeIMO.Markdown.MarkdownDoc+HeadingInfo

Gets heading metadata from a Markdown document.

Remarks

Returns heading level, text, resolved anchor, and the backing heading block.

Examples

Authored help example

Read headings from Markdown text.

PS>


Get-OfficeMarkdownHeading -Text "# Title`n`n## Details"
        

Parses Markdown text and returns the document headings.

Inspect a parsed Markdown document.

PS>


Get-OfficeMarkdown -Path .\README.md | Get-OfficeMarkdownHeading -MinLevel 2
        

Returns headings from an existing Markdown document object.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Get-OfficeMarkdownHeading [-AllowDataUrls <Nullable`1>] [-AllowedUrlScheme <String[]>] [-AllowMailtoUrls <Nullable`1>] [-AllowProtocolRelativeUrls <Nullable`1>] [-Anchor <String>] [-BaseUri <String>] [-CaseSensitive] [-DisallowFileUrls <Nullable`1>] [-HeadingText <String>] -InputPath <String> [-MaxInputCharacters <Nullable`1>] [-MaxLevel <Int32>] [-MinLevel <Int32>] [-NormalizeInput <Nullable`1>] [-Options <MarkdownReaderOptions>] [-Profile <Nullable`1>] [-RestrictUrlSchemes <Nullable`1>] [<CommonParameters>]
#
Parameter set: Path

Parameters

AllowDataUrls Nullable`1 optionalposition: namedpipeline: False
Allow data URLs while parsing Markdown links and images.
AllowedUrlScheme String[] optionalposition: namedpipeline: False
Allowed URL schemes when URL scheme restriction is enabled.
AllowMailtoUrls Nullable`1 optionalposition: namedpipeline: False
Allow mailto URLs while parsing Markdown links.
AllowProtocolRelativeUrls Nullable`1 optionalposition: namedpipeline: False
Allow protocol-relative URLs while parsing Markdown links and images.
Anchor String optionalposition: namedpipeline: False
Optional wildcard pattern matched against resolved heading anchors.
BaseUri String optionalposition: namedpipeline: False
Base URI used to resolve and restrict relative Markdown links and images.
CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching for text and anchor filters.
DisallowFileUrls Nullable`1 optionalposition: namedpipeline: False
Block file URLs while parsing Markdown links and images.
HeadingText String optionalposition: namedpipeline: False
Optional wildcard pattern matched against heading text.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Path to the Markdown file.
MaxInputCharacters Nullable`1 optionalposition: namedpipeline: False
Maximum Markdown input length accepted by the reader.
MaxLevel Int32 optionalposition: namedpipeline: False
Maximum heading level to return.
MinLevel Int32 optionalposition: namedpipeline: False
Minimum heading level to return.
NormalizeInput Nullable`1 optionalposition: namedpipeline: False
Applies a built-in Markdown input normalization preset before parsing.
Options MarkdownReaderOptions optionalposition: namedpipeline: Falsealiases: ReaderOptions
Optional reader options used when parsing path or text input.
Profile Nullable`1 optionalposition: namedpipeline: False
Named reader profile used when Options is not supplied.
RestrictUrlSchemes Nullable`1 optionalposition: namedpipeline: False
Restrict parsed URL schemes to the allow-list.

Outputs

OfficeIMO.Markdown.MarkdownDoc+HeadingInfo

Get-OfficeMarkdownHeading [-AllowDataUrls <Nullable`1>] [-AllowedUrlScheme <String[]>] [-AllowMailtoUrls <Nullable`1>] [-AllowProtocolRelativeUrls <Nullable`1>] [-Anchor <String>] [-BaseUri <String>] [-CaseSensitive] [-DisallowFileUrls <Nullable`1>] -Document <MarkdownDoc> [-HeadingText <String>] [-MaxInputCharacters <Nullable`1>] [-MaxLevel <Int32>] [-MinLevel <Int32>] [-NormalizeInput <Nullable`1>] [-Options <MarkdownReaderOptions>] [-Profile <Nullable`1>] [-RestrictUrlSchemes <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

AllowDataUrls Nullable`1 optionalposition: namedpipeline: False
Allow data URLs while parsing Markdown links and images.
AllowedUrlScheme String[] optionalposition: namedpipeline: False
Allowed URL schemes when URL scheme restriction is enabled.
AllowMailtoUrls Nullable`1 optionalposition: namedpipeline: False
Allow mailto URLs while parsing Markdown links.
AllowProtocolRelativeUrls Nullable`1 optionalposition: namedpipeline: False
Allow protocol-relative URLs while parsing Markdown links and images.
Anchor String optionalposition: namedpipeline: False
Optional wildcard pattern matched against resolved heading anchors.
BaseUri String optionalposition: namedpipeline: False
Base URI used to resolve and restrict relative Markdown links and images.
CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching for text and anchor filters.
DisallowFileUrls Nullable`1 optionalposition: namedpipeline: False
Block file URLs while parsing Markdown links and images.
Document MarkdownDoc requiredposition: namedpipeline: True (ByValue)
Markdown document to inspect.
HeadingText String optionalposition: namedpipeline: False
Optional wildcard pattern matched against heading text.
MaxInputCharacters Nullable`1 optionalposition: namedpipeline: False
Maximum Markdown input length accepted by the reader.
MaxLevel Int32 optionalposition: namedpipeline: False
Maximum heading level to return.
MinLevel Int32 optionalposition: namedpipeline: False
Minimum heading level to return.
NormalizeInput Nullable`1 optionalposition: namedpipeline: False
Applies a built-in Markdown input normalization preset before parsing.
Options MarkdownReaderOptions optionalposition: namedpipeline: Falsealiases: ReaderOptions
Optional reader options used when parsing path or text input.
Profile Nullable`1 optionalposition: namedpipeline: False
Named reader profile used when Options is not supplied.
RestrictUrlSchemes Nullable`1 optionalposition: namedpipeline: False
Restrict parsed URL schemes to the allow-list.

Outputs

OfficeIMO.Markdown.MarkdownDoc+HeadingInfo

Get-OfficeMarkdownHeading [-AllowDataUrls <Nullable`1>] [-AllowedUrlScheme <String[]>] [-AllowMailtoUrls <Nullable`1>] [-AllowProtocolRelativeUrls <Nullable`1>] [-Anchor <String>] [-BaseUri <String>] [-CaseSensitive] [-DisallowFileUrls <Nullable`1>] [-HeadingText <String>] [-MaxInputCharacters <Nullable`1>] [-MaxLevel <Int32>] [-MinLevel <Int32>] [-NormalizeInput <Nullable`1>] [-Options <MarkdownReaderOptions>] [-Profile <Nullable`1>] [-RestrictUrlSchemes <Nullable`1>] -Text <String> [<CommonParameters>]
#
Parameter set: Text

Parameters

AllowDataUrls Nullable`1 optionalposition: namedpipeline: False
Allow data URLs while parsing Markdown links and images.
AllowedUrlScheme String[] optionalposition: namedpipeline: False
Allowed URL schemes when URL scheme restriction is enabled.
AllowMailtoUrls Nullable`1 optionalposition: namedpipeline: False
Allow mailto URLs while parsing Markdown links.
AllowProtocolRelativeUrls Nullable`1 optionalposition: namedpipeline: False
Allow protocol-relative URLs while parsing Markdown links and images.
Anchor String optionalposition: namedpipeline: False
Optional wildcard pattern matched against resolved heading anchors.
BaseUri String optionalposition: namedpipeline: False
Base URI used to resolve and restrict relative Markdown links and images.
CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching for text and anchor filters.
DisallowFileUrls Nullable`1 optionalposition: namedpipeline: False
Block file URLs while parsing Markdown links and images.
HeadingText String optionalposition: namedpipeline: False
Optional wildcard pattern matched against heading text.
MaxInputCharacters Nullable`1 optionalposition: namedpipeline: False
Maximum Markdown input length accepted by the reader.
MaxLevel Int32 optionalposition: namedpipeline: False
Maximum heading level to return.
MinLevel Int32 optionalposition: namedpipeline: False
Minimum heading level to return.
NormalizeInput Nullable`1 optionalposition: namedpipeline: False
Applies a built-in Markdown input normalization preset before parsing.
Options MarkdownReaderOptions optionalposition: namedpipeline: Falsealiases: ReaderOptions
Optional reader options used when parsing path or text input.
Profile Nullable`1 optionalposition: namedpipeline: False
Named reader profile used when Options is not supplied.
RestrictUrlSchemes Nullable`1 optionalposition: namedpipeline: False
Restrict parsed URL schemes to the allow-list.
Text String requiredposition: namedpipeline: False
Markdown text to parse.

Outputs

OfficeIMO.Markdown.MarkdownDoc+HeadingInfo