Cmdlet
ConvertFrom-OfficeMarkdownHtml
Converts HTML content to Markdown.
Syntax
ConvertFrom-OfficeMarkdownHtml [-AsDocument] [-Base64ImageHandling <Include|Skip|SaveToFile>] [-Base64ImageOutputDirectory <String>] [-BaseUri <String>] [-DropUnsupportedBlocks] [-DropUnsupportedInlineHtml] [-Html] <String> [-ImageRenderingMode <RichMarkdown|PortableMarkdown|Html>] [-IncludeDocumentChrome] [-LineEnding <String>] [-ListingCardMetadataMode <Preserve|SuppressInRepeatedCards>] [-MaxInputCharacters <Int32>] [-MaxTableExpandedColumns <Int32>] [-Options <HtmlToMarkdownOptions>] [-OutputPath <String>] [-PassThru] [-Portable] [-PreserveScriptsAndStyles] [-UnorderedListMarker <String>] [-WriteOptions <MarkdownWriteOptions>] [-WriteProfile <OfficeIMO|Portable|HtmlImage>] [<CommonParameters>]#Parameter set:
HtmlConvertFrom-OfficeMarkdownHtml [-AsDocument] [-Base64ImageHandling <Include|Skip|SaveToFile>] [-Base64ImageOutputDirectory <String>] [-BaseUri <String>] [-DropUnsupportedBlocks] [-DropUnsupportedInlineHtml] [-ImageRenderingMode <RichMarkdown|PortableMarkdown|Html>] [-IncludeDocumentChrome] [-LineEnding <String>] [-ListingCardMetadataMode <Preserve|SuppressInRepeatedCards>] [-MaxInputCharacters <Int32>] [-MaxTableExpandedColumns <Int32>] [-Options <HtmlToMarkdownOptions>] [-OutputPath <String>] [-PassThru] [-Path] <String> [-Portable] [-PreserveScriptsAndStyles] [-UnorderedListMarker <String>] [-WriteOptions <MarkdownWriteOptions>] [-WriteProfile <OfficeIMO|Portable|HtmlImage>] [<CommonParameters>]#Parameter set:
PathDescription
Returns Markdown text or saves it to a file when -OutputPath is specified.
Examples
Convert an HTML fragment to Markdown.
$markdown = ConvertFrom-OfficeMarkdownHtml -Html '<h1>Report</h1><p>Ready</p>'Returns Markdown text converted from the supplied HTML.
Convert an HTML file to a Markdown document object.
$doc = ConvertFrom-OfficeMarkdownHtml -Path .\report.html -AsDocumentReturns a Markdown document for further editing or rendering.
Parameters
- -AsDocument SwitchParameter
- Emit a Markdown document object instead of Markdown text.
- -Base64ImageHandling HtmlBase64ImageHandling
- Controls how base64 data URI images are converted.
- Possible values:
Include,Skip,SaveToFile - -Base64ImageOutputDirectory String
- Output directory for decoded base64 images when saving them to files.
- -BaseUri String
- Base URI used to resolve relative links and image sources.
- -DropUnsupportedBlocks SwitchParameter
- Drop unsupported block HTML instead of preserving it as raw HTML.
- -DropUnsupportedInlineHtml SwitchParameter
- Drop unsupported inline HTML instead of preserving it as raw HTML.
- -Html String
- HTML markup to convert.
- -ImageRenderingMode MarkdownImageRenderingMode
- Controls how generated Markdown images are serialized.
- Possible values:
RichMarkdown,PortableMarkdown,Html - -IncludeDocumentChrome SwitchParameter
- Convert the full HTML document instead of only body contents.
- -LineEnding String
- Markdown line ending: CRLF, LF, CR, or a literal line ending string.
- -ListingCardMetadataMode HtmlListingCardMetadataMode
- Controls whether repeated listing-card metadata is preserved or suppressed.
- Possible values:
Preserve,SuppressInRepeatedCards - -MaxInputCharacters Int32
- Maximum input length, in characters, accepted by the converter.
- -MaxTableExpandedColumns Int32
- Maximum logical columns produced by expanding HTML table spans.
- -Options HtmlToMarkdownOptions
- Optional conversion options.
- -OutputPath String
- Optional output path for the Markdown file.
- -PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- -Portable SwitchParameter
- Use portable Markdown output when Options is not supplied.
- -PreserveScriptsAndStyles SwitchParameter
- Preserve script, style, noscript, and template elements.
- -UnorderedListMarker String
- Unordered list marker: '-', '*', or '+'.
- -WriteOptions MarkdownWriteOptions
- Optional Markdown writer options for generated Markdown text.
- -WriteProfile OfficeMarkdownWriteProfile
- Friendly Markdown writer profile for generated Markdown text.
- Possible values:
OfficeIMO,Portable,HtmlImage - -Path String
- Path to an HTML file.
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.