Skip to content

Format-Markdown

SYNOPSIS

Formats a markdown file to ensure it follows the markdownlint rules.

SYNTAX

Path (Default)

Format-Markdown [-Path] <String> [-CodeBlockLanguage <String>]
 [-EmphasisAsHeaderConversion <MarkdownEmphasisAsHeaderConversion>]
 [<CommonParameters>]

Pipeline

Format-Markdown [-CodeBlockLanguage <String>]
 [-EmphasisAsHeaderConversion <MarkdownEmphasisAsHeaderConversion>]
 [<CommonParameters>]

DESCRIPTION

This cmdlet aims to format a markdown file to ensure it follows the markdownlint rules.
Currently not all rules are implemented as this is mostly being used to format markdown generated by PlatyPS.

EXAMPLES

Example 1

Format-Markdown -Path .\README.md

Would format the README.md file in the current directory and return a string containing the formatted markdown.

PARAMETERS

-CodeBlockLanguage

The language to use for any untagged code blocks.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: Text
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-EmphasisAsHeaderConversion

The conversion to use for any emphasis-as-headers.

Type: MarkdownEmphasisAsHeaderConversion
Parameter Sets: (All)
Aliases:
Accepted values: List, Header

Required: False
Position: Named
Default value: Header
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Path

The path to the markdown file to format.

Type: String
Parameter Sets: Path
Aliases:

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

CommonParameters

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

INPUTS

OUTPUTS

NOTES