API Reference

Cmdlet

ConvertFrom-OfficeMarkdownHtml

Aliases: ConvertFrom-MarkdownHtml
Namespace PSWriteOffice
Aliases
ConvertFrom-MarkdownHtml
Inputs
System.String
Outputs
System.String System.IO.FileInfo OfficeIMO.Markdown.MarkdownDoc

Converts HTML content to Markdown.

Remarks

Returns Markdown text or saves it to a file when -OutputPath is specified.

Examples

Authored help example

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: Html

Parameters

AsDocument SwitchParameter optionalposition: namedpipeline: False
Emit a Markdown document object instead of Markdown text.
Base64ImageHandling Nullable`1 optionalposition: namedpipeline: False
Controls how base64 data URI images are converted.
Base64ImageOutputDirectory String optionalposition: namedpipeline: False
Output directory for decoded base64 images when saving them to files.
BaseUri String optionalposition: namedpipeline: False
Base URI used to resolve relative links and image sources.
DropUnsupportedBlocks SwitchParameter optionalposition: namedpipeline: False
Drop unsupported block HTML instead of preserving it as raw HTML.
DropUnsupportedInlineHtml SwitchParameter optionalposition: namedpipeline: False
Drop unsupported inline HTML instead of preserving it as raw HTML.
Html String requiredposition: 0pipeline: True (ByValue)
HTML markup to convert.
ImageRenderingMode Nullable`1 optionalposition: namedpipeline: False
Controls how generated Markdown images are serialized.
IncludeDocumentChrome SwitchParameter optionalposition: namedpipeline: False
Convert the full HTML document instead of only body contents.
LineEnding String optionalposition: namedpipeline: False
Markdown line ending: CRLF, LF, CR, or a literal line ending string.
ListingCardMetadataMode Nullable`1 optionalposition: namedpipeline: False
Controls whether repeated listing-card metadata is preserved or suppressed.
MaxInputCharacters Nullable`1 optionalposition: namedpipeline: False
Maximum input length, in characters, accepted by the converter.
MaxTableExpandedColumns Nullable`1 optionalposition: namedpipeline: False
Maximum logical columns produced by expanding HTML table spans.
Options HtmlToMarkdownOptions optionalposition: namedpipeline: False
Optional conversion options.
OutputPath String optionalposition: namedpipeline: Falsealiases: OutPath
Optional output path for the Markdown file.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo when saving to disk.
Portable SwitchParameter optionalposition: namedpipeline: False
Use portable Markdown output when Options is not supplied.
PreserveScriptsAndStyles SwitchParameter optionalposition: namedpipeline: False
Preserve script, style, noscript, and template elements.
UnorderedListMarker String optionalposition: namedpipeline: False
Unordered list marker: '-', '*', or '+'.
WriteOptions MarkdownWriteOptions optionalposition: namedpipeline: False
Optional Markdown writer options for generated Markdown text.
WriteProfile Nullable`1 optionalposition: namedpipeline: False
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: Path

Parameters

AsDocument SwitchParameter optionalposition: namedpipeline: False
Emit a Markdown document object instead of Markdown text.
Base64ImageHandling Nullable`1 optionalposition: namedpipeline: False
Controls how base64 data URI images are converted.
Base64ImageOutputDirectory String optionalposition: namedpipeline: False
Output directory for decoded base64 images when saving them to files.
BaseUri String optionalposition: namedpipeline: False
Base URI used to resolve relative links and image sources.
DropUnsupportedBlocks SwitchParameter optionalposition: namedpipeline: False
Drop unsupported block HTML instead of preserving it as raw HTML.
DropUnsupportedInlineHtml SwitchParameter optionalposition: namedpipeline: False
Drop unsupported inline HTML instead of preserving it as raw HTML.
ImageRenderingMode Nullable`1 optionalposition: namedpipeline: False
Controls how generated Markdown images are serialized.
IncludeDocumentChrome SwitchParameter optionalposition: namedpipeline: False
Convert the full HTML document instead of only body contents.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Path to an HTML file.
LineEnding String optionalposition: namedpipeline: False
Markdown line ending: CRLF, LF, CR, or a literal line ending string.
ListingCardMetadataMode Nullable`1 optionalposition: namedpipeline: False
Controls whether repeated listing-card metadata is preserved or suppressed.
MaxInputCharacters Nullable`1 optionalposition: namedpipeline: False
Maximum input length, in characters, accepted by the converter.
MaxTableExpandedColumns Nullable`1 optionalposition: namedpipeline: False
Maximum logical columns produced by expanding HTML table spans.
Options HtmlToMarkdownOptions optionalposition: namedpipeline: False
Optional conversion options.
OutputPath String optionalposition: namedpipeline: Falsealiases: OutPath
Optional output path for the Markdown file.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo when saving to disk.
Portable SwitchParameter optionalposition: namedpipeline: False
Use portable Markdown output when Options is not supplied.
PreserveScriptsAndStyles SwitchParameter optionalposition: namedpipeline: False
Preserve script, style, noscript, and template elements.
UnorderedListMarker String optionalposition: namedpipeline: False
Unordered list marker: '-', '*', or '+'.
WriteOptions MarkdownWriteOptions optionalposition: namedpipeline: False
Optional Markdown writer options for generated Markdown text.
WriteProfile Nullable`1 optionalposition: namedpipeline: False
Friendly Markdown writer profile for generated Markdown text.

Outputs

System.String System.IO.FileInfo OfficeIMO.Markdown.MarkdownDoc