-
Notifications
You must be signed in to change notification settings - Fork 1
Switch YamlFrontMatterToCodeFence
external help file: WhatsNew.dll-Help.xml
Module Name: WhatsNew
schema: 2.0.0
Converts yaml front matter to a markdown code fence.
Switch-YamlFrontMatterToCodeFence [-Path] <String> [-NoConfirm] [<CommonParameters>]
If you happen to use platyPS to create markdown documentation for PowerShell modules (as I do), you may have noticed that the metadata platyPS emits as yaml front matter doesn't render all that nicely on GitHub. This command, along with the corresponding Switch-CodeFenceToYamlFrontMatter, is a bit of a hack that allow you to both keep the metadata and have markdown docs that look pretty on GitHub. All it does is take the yaml front matter syntax (three dashes) and change it to codefence syntax (three backticks). However, you have to remember to convert the code fence back to yaml before you attempt to run Update-MarkdownHelp. Otherwise, you'll run into a parse error.
PS C:\> Switch-YamlFrontMatterToCodeFence -Path "C:\Repos\whats-new.wiki"Loads each markdown file found in C:\Repos\whats-new.wiki, converts any contained yaml front matter to a code fence, and overwrites the original file with the changes.
The directory containing markdown files with yaml front matter.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseUpdate the files without prompting first.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.