File-manager integration

mdo's core convenience: open a .md file from your file manager and read it as rendered HTML immediately. Every integration launches the same mdo --open render-and-open path, so no .html file is ever left beside the source — output goes to a stable per-file temp path:

Windows  %TEMP%\mdo\<hash>\<name>.html
Linux    /tmp/mdo-<uid>/<hash>/<name>.html
macOS    $TMPDIR/mdo-<uid>/<hash>/<name>.html

The file-handler registration is per-user and reversible with mdo --uninstall-file-manager. (On Linux, the separate mdo Setup application-menu launcher and the installed binaries are untouched by that command; see the implementation details below.)

Windows Explorer

mdo.exe installs or removes its own per-user Explorer integration (no admin rights and no HKLM changes). Windows release ZIPs also include mdo-setup.exe, a double-clickable guided setup:

# Open the first-run setup (offers the optional Explorer integration install)
.\mdo-setup.exe

# CLI install: add an "Open as HTML" right-click verb and Open With app entry
.\mdo.exe --install-file-manager

# Undo everything the installer did
.\mdo.exe --uninstall-file-manager

Result after install:

To make Open as HTML the default .md handler after installing, right-click a .md file → Open with → Choose another app → pick Open as HTML → tick Always use this app. Windows requires that last step to be done interactively.

Rerunning the installer is safe: it detects its own existing registration and keeps setup idempotent.

Windows implementation details

Linux file managers

mdo installs or removes its own per-user XDG integration; no companion install script is required:

# Open the first-run setup in a terminal (offers the optional integration install)
mdo-setup

# Add "Open as HTML" as an "Open With" handler for Markdown files
mdo --install-file-manager

# Same, but also make it the default Markdown handler
mdo --install-file-manager --set-default

# Undo everything the installer did
mdo --uninstall-file-manager

Result after install:

Linux implementation details

macOS Finder quick action

mdo does not ship a macOS installer yet, but Finder can run mdo --open through a per-user Automator Quick Action. Apple documents Quick Action workflows and shell-script actions in the Automator User Guide:

Create a Quick Action in Automator, set it to receive files in Finder, add Run Shell Script, set Pass input to as arguments, and use the absolute path to mdo:

for file in "$@"; do
  /path/to/mdo --open "$file"
done

Save the workflow as Open as HTML. Finder then shows Quick Actions → Open as HTML for selected Markdown files, and running it opens the rendered page in your browser from the temp path above.