Skip to content

New MarkdownTableOfContents

Nick Spreitzer edited this page Nov 16, 2019 · 6 revisions
external help file: WhatsNew.dll-Help.xml
Module Name: WhatsNew
schema: 2.0.0

New-MarkdownTableOfContents

SYNOPSIS

Creates a table of contents for a collection of markdown files, specifically for use with GitHub wiki pages.

SYNTAX

New-MarkdownTableOfContents [-Path] <String> [-Filter] <String> [-BaseUrl] <String> [[-ListType] <String>]
 [<CommonParameters>]

DESCRIPTION

Use this command to create a markdown-formatted table of contents that corresponds to a collection of markdown files. This was specifically written in order to create a table of contents like you can see here on the WhatsNew wiki home page. The command assumes each markdown file can be reached online by a predictable URL format, as is the case with GitHub wiki pages.

EXAMPLES

Example 1

PS C:\> New-MarkdownTableOfContents
  -Path 'C:\Repos\whats-new.wiki'
  -Filter "*-*.md"
  -BaseUrl 'https://github.com/refactorsaurusrex/whats-new/wiki'
  -ListType Unordered

Creates an unordered markdown list of all the files contained in C:\Repos\whats-new.wiki that match the pattern *-*.md, prepends the BaseUrl, and outputs the results. The results of this command can be seen on the WhatsNew wiki home page.

BONUS FEATURE: If you install ClipboardText, you can pipe the results of the above command to Set-ClipboardText and paste wherever you want!

PARAMETERS

-Path

Either the path to a specific file, or a directory containing a collection of files from which to create a table of contents.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Filter

The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-BaseUrl

The url which should be prepended to the file name to create valid URLs for each table of contents item.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ListType

Specify whether to create an ordered or unordered list. The default is unordered.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: Unordered
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.String

NOTES

RELATED LINKS

New-MarkdownTableOfContents

Clone this wiki locally