| external help file | PSTextMate.dll-Help.xml |
|---|---|
| Module Name | TextMate |
| online version | https://github.com/trackd/TextMate/blob/main/docs/en-us |
| schema | 2.0.0 |
Renders Markdown input using TextMate grammars or the module's alternate renderer and returns a PSTextMate.Core.HighlightedText object.
Format-Markdown [-InputObject] <PSObject> [-Alternate] [-Theme <ThemeName>] [-LineNumbers]
[<CommonParameters>]
This cmdlet has the following aliases, fmd
Format-Markdown highlights Markdown content using the Markdown grammar where appropriate.
Use the -Alternate switch to force TextMate renderer as opposed to custom Markdig rendering.
Input may be piped in as text or read from files.
The cmdlet returns a HighlightedText object for rendering.
Example: highlight a Markdown string
"# Title`n`n- item1`n- item2" | Format-Markdown
Example: format a file using the alternate renderer
Get-Content README.md -Raw | Format-Markdown -Alternate
Example: pipe FileInfo object and use a theme and line numbers
Get-ChildItem docs\guide.md | Format-Markdown -Theme SolarizedLight -LineNumbers
Accepts a string or object containing Markdown text. Common usage is Get-Content -Raw piped into the cmdlet.
FileInfo objects are also accepted
Type: PSObject
DefaultValue: ''
SupportsWildcards: false
Aliases:
- FullName
- Path
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: true
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Includes line numbers in the rendered output when specified.
Type: SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Selects a TextMateSharp.Grammars.ThemeName to style the output. If omitted, the module default is used.
Type: TextMateSharp.Grammars.ThemeName
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''When present, forces the module's TextMate rendering instead of the custom Markdig rendering path. Useful for testing alternate presentation.
Type: SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''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.
Accepts Markdown text as a string or an object that can provide textual content.
Returns a HighlightedText object representing the highlighted Markdown content.
The Markdown renderer may apply special handling for fenced code blocks and front-matter when UsesMarkdownBaseDirectory is enabled. Use -Alternate to bypass markdown-specific rendering.
See Format-CSharp and Format-PowerShell for language-specific renderers.