mhtml-to-html

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 2 Imported by: 0

README

mhtml-to-html

This command line converts .mhtml to .html

GitHub go.mod Go version Build GitHub license

Install
> go install github.com/mpr1255/mhtml-to-html@latest
Usage

By default, mhtml-to-html outputs HTML to stdout (like pdftotext).

Output Behavior:

  • Stdout mode (no -o flag): Images are stripped for clean text processing in pipelines
  • File mode (-o flag): Images and resources are preserved
  • Extract files mode (--extract-files): Creates {filename}_files/ directory with external resources
# Extract text content to stdout (images removed)
> mhtml-to-html document.mht

# Save HTML to file (images preserved)
> mhtml-to-html document.mht -o output.html

# Extract with external resource files
> mhtml-to-html document.mht -o output.html --extract-files

# Process with verbose output
> mhtml-to-html document.mhtml --verbose -o converted.html
Flags
  -h, --help              Show context-sensitive help.
      --verbose           Verbose printing.
      --version           Show version.
      --extract-files     Extract resources to external files (default: embed as data URIs).
  -o, --output=STRING     Output file (default: stdout).
Examples
# Extract text content to terminal (images stripped)
> mhtml-to-html email.mht

# Save converted HTML file (images preserved)
> mhtml-to-html email.mht -o email.html

# Save with external resource files
> mhtml-to-html email.mht -o email.html --extract-files

# Pipe output to other tools (text processing)
> mhtml-to-html document.mht | grep "important text"

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL