New-HTMLMarkdown
Creates HTML content from Markdown text with customizable options.
Syntax
New-HTMLMarkdown [-DisableTables] [-EnableBackslashEscapes] [-EnableBackslashEscapesHTMLTags] [-EnableEmoji] [-EnableEncodeEmails] [-EnableGithubCodeBlocks] [-EnableMoreStyling] [-EnableOpenLinksInNewWindow] [-EnableRequireSpaceBeforeHeadingText] [-EnableSimpleLineBreaks] [-EnableStrikethrough] [-EnableTaskLists] [-EnableTOC] [-Encoding <String>] -FilePath <String> [-HeaderLevelStart <Int32>] [-Id <String>] [-omitExtraWLInCodeBlocks] [-SanitezeHTML] [<CommonParameters>]#FilePathNew-HTMLMarkdown [-DisableTables] [-EnableBackslashEscapes] [-EnableBackslashEscapesHTMLTags] [-EnableEmoji] [-EnableEncodeEmails] [-EnableGithubCodeBlocks] [-EnableMoreStyling] [-EnableOpenLinksInNewWindow] [-EnableRequireSpaceBeforeHeadingText] [-EnableSimpleLineBreaks] [-EnableStrikethrough] [-EnableTaskLists] [-EnableTOC] [-Encoding <String>] [-HeaderLevelStart <Int32>] [-Id <String>] [-omitExtraWLInCodeBlocks] [-SanitezeHTML] [-ScriptBlock] <ScriptBlock> [<CommonParameters>]#ScriptBlockNew-HTMLMarkdown -Content <Array> [-DisableTables] [-EnableBackslashEscapes] [-EnableBackslashEscapesHTMLTags] [-EnableEmoji] [-EnableEncodeEmails] [-EnableGithubCodeBlocks] [-EnableMoreStyling] [-EnableOpenLinksInNewWindow] [-EnableRequireSpaceBeforeHeadingText] [-EnableSimpleLineBreaks] [-EnableStrikethrough] [-EnableTaskLists] [-EnableTOC] [-Encoding <String>] [-HeaderLevelStart <Int32>] [-Id <String>] [-omitExtraWLInCodeBlocks] [-SanitezeHTML] [<CommonParameters>]#ContentDescription
The New-HTMLMarkdown function converts Markdown text to HTML content with various customization options such as strikethrough, emojis, code block styling, table of contents, and more.
Examples
EXAMPLE 1
New-HTMLMarkdown -FilePath "C:\Markdown\example.md" -EnableStrikethrough -EnableEmoji -EnableTOCConverts the Markdown content from the file "example.md" to HTML with strikethrough, emojis, and a table of contents.
EXAMPLE 2
$MarkdownContent = @("## Title", "This is a **bold** text.")
New-HTMLMarkdown -Content $MarkdownContent -EnableMoreStyling -EnableTaskListsConverts the Markdown content in the array with additional styling and task list support.
Parameters
- -DisableTables SwitchParameter
- Switch parameter to disable table rendering.
- -EnableBackslashEscapes SwitchParameter
- Switch parameter to enable backslash escapes.
- Switch parameter to enable backslash escapes for HTML tags.
- -EnableEmoji SwitchParameter
- Switch parameter to enable emoji support.
- -EnableEncodeEmails SwitchParameter
- Switch parameter to enable email encoding.
- -EnableGithubCodeBlocks SwitchParameter
- Switch parameter to enable GitHub-style code blocks.
- -EnableMoreStyling SwitchParameter
- Switch parameter to enable additional styling options.
- -EnableOpenLinksInNewWindow SwitchParameter
- Switch parameter to open links in a new window.
- -EnableRequireSpaceBeforeHeadingText SwitchParameter
- Switch parameter to require space before heading text.
- -EnableSimpleLineBreaks SwitchParameter
- Switch parameter to enable simple line breaks.
- -EnableStrikethrough SwitchParameter
- Switch parameter to enable strikethrough styling.
- -EnableTaskLists SwitchParameter
- Switch parameter to enable task lists in Markdown.
- -EnableTOC SwitchParameter
- Switch parameter to enable table of contents generation.
- -Encoding String
- Specifies the encoding for reading the Markdown content file. Default is 'UTF8'.
- -FilePath String
- Specifies the path to a file containing Markdown content to convert.
- -HeaderLevelStart Int32
- Specifies the starting header level for Markdown content.
- -Id String
- Specifies the ID attribute for the HTML container.
- -omitExtraWLInCodeBlocks SwitchParameter
- Switch parameter to omit extra whitespace in code blocks.
- -SanitezeHTML SwitchParameter
- Switch parameter to sanitize HTML content.
- -ScriptBlock ScriptBlock
- Specifies a script block containing Markdown content to convert.
- -Content Array
- Specifies an array of Markdown content to convert.
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.