Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeMarkdownTableOfContents

Aliases: MarkdownTableOfContents
Module
PSWriteOffice
Aliases
MarkdownTableOfContents
Inputs
OfficeIMO.Markdown.MarkdownDocument
Outputs
OfficeIMO.Markdown.MarkdownDocument

Adds a Markdown table of contents placeholder.

Syntax

Add-OfficeMarkdownTableOfContents
[-MaxLevel <Int32>]
[-MinLevel <Int32>]
[-Numbered]
[-PassThru]
[-Placement <Current|Top|PreviousHeading>]
[-Title <String>]
[-TitleLevel <Int32>]
[<CommonParameters>]
#
Parameter set: Placement
Add-OfficeMarkdownTableOfContents
-Document <MarkdownDocument>
[-MaxLevel <Int32>]
[-MinLevel <Int32>]
[-Numbered]
[-PassThru]
[-Placement <Current|Top|PreviousHeading>]
[-Title <String>]
[-TitleLevel <Int32>]
[<CommonParameters>]
#
Parameter set: DocumentPlacement
Add-OfficeMarkdownTableOfContents
-Document <MarkdownDocument>
[-MaxLevel <Int32>]
[-MinLevel <Int32>]
[-Numbered]
[-PassThru]
-Section <String>
[-Title <String>]
[-TitleLevel <Int32>]
[<CommonParameters>]
#
Parameter set: DocumentSection
Add-OfficeMarkdownTableOfContents
[-MaxLevel <Int32>]
[-MinLevel <Int32>]
[-Numbered]
[-PassThru]
-Section <String>
[-Title <String>]
[-TitleLevel <Int32>]
[<CommonParameters>]
#
Parameter set: Section

Examples

Add a TOC at the top of a generated report.

New-OfficeMarkdown -Path .\Report.md {
    Add-OfficeMarkdownHeading -Level 1 -Text 'Release Report'
    Add-OfficeMarkdownHeading -Level 2 -Text 'Summary'
    Add-OfficeMarkdownParagraph -Text 'Current state and risks.'
    Add-OfficeMarkdownHeading -Level 2 -Text 'Appendix'
    Add-OfficeMarkdownParagraph -Text 'Supporting evidence.'
    Add-OfficeMarkdownTableOfContents -Title 'Contents' -MinLevel 2 -MaxLevel 3 -Placement Top
}

Inserts a generated table of contents for headings in the document.

Parameters

-MaxLevel Int32 optional
Maximum heading depth included in the table of contents.
-MinLevel Int32 optional
Minimum heading depth included in the table of contents.
-Numbered SwitchParameter optional
Generate an ordered table of contents list.
-PassThru SwitchParameter optional
Emit the updated Markdown document.
-Placement MarkdownTocPlacement optionalsets: Placement, DocumentPlacement
Where to place the TOC.
Possible values: Current, Top, PreviousHeading
-Title String optional
Heading text displayed above the generated table of contents.
-TitleLevel Int32 optional
Heading level used for the TOC title.
-Document MarkdownDocument requiredpipeline: True (ByValue)sets: DocumentPlacement, DocumentSection
Markdown document to update outside the DSL context.
-Section String requiredsets: DocumentSection, Section
Scope the TOC to the named section heading.

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.