View script Copied!
Render markdown to HTML and open it in your browser. The output uses GitHub-like styling with automatic dark/light mode.
Note: Unlike the other scripts in this repo,
render-mdis a Node.js CLI (a self-contained single file, but it needs Node ≥ 18 on your$PATH). Everything else in the catalog is bash. If you don't have Node yet,brew install nodeis the fast path;pwa-prereqs --installalso handles it.
render-md README.md
That's it -- your browser opens with the rendered page. Relative links and images resolve against the source file's directory.
Pipe from stdin:
cat CHANGELOG.md | render-md
Write HTML to a file instead of opening the browser:
render-md README.md -o readme.html
Write HTML to stdout (for piping into other tools):
render-md README.md -o -
| Flag | Description |
|---|---|
file |
Markdown file to render (default: stdin) |
-x, --xss |
Enable XSS filtering (matches gh-proxy sanitization) |
-o FILE |
Write HTML to FILE instead of opening in browser |
-o - |
Write HTML to stdout |
-h, --help |
Show help |
| Variable | Description |
|---|---|
BROWSER |
Override which browser to open. Default: first available of Chrome, Edge, Firefox, Safari |
Requires Node.js. The marked markdown parser is bundled into the script -- no npm install needed at runtime.