API Reference
Cmdlet
ConvertFrom-OfficeMarkdownHtml
Converts HTML content to Markdown.
Remarks
Returns Markdown text or saves it to a file when -OutputPath is specified.
Examples
Convert an HTML fragment to Markdown.
PS>
$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.
PS>
$doc = ConvertFrom-OfficeMarkdownHtml -Path .\report.html -AsDocument
Returns a Markdown document for further editing or rendering.
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.
Syntax
ConvertFrom-OfficeMarkdownHtml [-AsDocument] [-Base64ImageHandling <Nullable`1>] [-Base64ImageOutputDirectory <String>] [-BaseUri <String>] [-DropUnsupportedBlocks] [-DropUnsupportedInlineHtml] -Html <String> [-ImageRenderingMode <Nullable`1>] [-IncludeDocumentChrome] [-LineEnding <String>] [-ListingCardMetadataMode <Nullable`1>] [-MaxInputCharacters <Nullable`1>] [-MaxTableExpandedColumns <Nullable`1>] [-Options <HtmlToMarkdownOptions>] [-OutputPath <String>] [-PassThru] [-Portable] [-PreserveScriptsAndStyles] [-UnorderedListMarker <String>] [-WriteOptions <MarkdownWriteOptions>] [-WriteProfile <Nullable`1>] [<CommonParameters>]#Parameter set:
HtmlParameters
- AsDocument SwitchParameter
- Emit a Markdown document object instead of Markdown text.
- Base64ImageHandling Nullable`1
- Controls how base64 data URI images are converted.
- 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 Nullable`1
- Controls how generated Markdown images are serialized.
- 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 Nullable`1
- Controls whether repeated listing-card metadata is preserved or suppressed.
- MaxInputCharacters Nullable`1
- Maximum input length, in characters, accepted by the converter.
- MaxTableExpandedColumns Nullable`1
- 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 Nullable`1
- Friendly Markdown writer profile for generated Markdown text.
Outputs
System.String System.IO.FileInfo OfficeIMO.Markdown.MarkdownDoc
ConvertFrom-OfficeMarkdownHtml [-AsDocument] [-Base64ImageHandling <Nullable`1>] [-Base64ImageOutputDirectory <String>] [-BaseUri <String>] [-DropUnsupportedBlocks] [-DropUnsupportedInlineHtml] [-ImageRenderingMode <Nullable`1>] [-IncludeDocumentChrome] -InputPath <String> [-LineEnding <String>] [-ListingCardMetadataMode <Nullable`1>] [-MaxInputCharacters <Nullable`1>] [-MaxTableExpandedColumns <Nullable`1>] [-Options <HtmlToMarkdownOptions>] [-OutputPath <String>] [-PassThru] [-Portable] [-PreserveScriptsAndStyles] [-UnorderedListMarker <String>] [-WriteOptions <MarkdownWriteOptions>] [-WriteProfile <Nullable`1>] [<CommonParameters>]#Parameter set:
PathParameters
- AsDocument SwitchParameter
- Emit a Markdown document object instead of Markdown text.
- Base64ImageHandling Nullable`1
- Controls how base64 data URI images are converted.
- 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.
- ImageRenderingMode Nullable`1
- Controls how generated Markdown images are serialized.
- IncludeDocumentChrome SwitchParameter
- Convert the full HTML document instead of only body contents.
- InputPath String
- Path to an HTML file.
- LineEnding String
- Markdown line ending: CRLF, LF, CR, or a literal line ending string.
- ListingCardMetadataMode Nullable`1
- Controls whether repeated listing-card metadata is preserved or suppressed.
- MaxInputCharacters Nullable`1
- Maximum input length, in characters, accepted by the converter.
- MaxTableExpandedColumns Nullable`1
- 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 Nullable`1
- Friendly Markdown writer profile for generated Markdown text.
Outputs
System.String System.IO.FileInfo OfficeIMO.Markdown.MarkdownDoc