open-md
v0.3.1
Published
Convert a markdown file to a readable HTML page and open it in the browser.
Readme
open-md
Convert a markdown file to a styled HTML page and open it in the browser — one command, no setup.
npx open-md@latest path/to/file.mdopen-md takes a markdown file, renders it to a complete, self-contained HTML page, and opens it in your default browser. Useful when working with coding agents: let the agent produce markdown (its best format), then read the result as a properly styled document.
Install & Usage
No install required — run directly with npx:
# Convert and open
npx open-md@latest document.md
# Convert without opening the browser
npx open-md@latest document.md --no-openThe HTML is written next to the source file as document.md.html.
If you use it often, install globally:
npm install -g open-md
open-md document.mdGive your coding agent this document to set up:
https://raw.githubusercontent.com/realtrung/open-md/main/AGENT_SETUP.mdFeatures
- GitHub-Flavored Markdown — tables, task lists, footnotes, strikethrough, autolinks.
- Syntax highlighting — fenced code blocks with a language tag are highlighted via highlight.js. Unlabeled blocks render as plain monospace; no false highlights.
- Math — inline
$e^{i\pi}+1=0$and display$$...$$equations rendered with KaTeX at page load. - Mermaid diagrams —
```mermaidfences are rendered as graphics in the browser. - OS light/dark theme — follows your system preference automatically. No toggle needed.
- Print styles — readable when printed or saved as PDF.
Output
The generated HTML lives next to the source file:
docs/plan.md → docs/plan.md.htmlEach output is a standalone HTML document. Open it in any browser or share it.
Known Limitations
- LaTeX
\\in matrices — markdown-it consumes\\as an escaped backslash before KaTeX sees it, so matrix row separators collapse to\. As a workaround, use\cror\newlineinstead of\\inside matrix environments.
License
MIT
