
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pi-markdown-preview
Advanced tools
Rendered markdown + LaTeX preview for pi, with terminal, browser, and PDF output
Preview assistant responses and local Markdown, LaTeX, code, diff, and other text-based files from pi in the terminal, browser, or as PDF, with math rendering, syntax highlighting, Mermaid, and theme-aware styling.
Preview adapts to your pi theme. Examples with a custom theme and the built-in defaults:
Terminal preview (custom theme):

Terminal preview (default dark):

Terminal preview (default light):

Browser preview (default dark and light):
```mermaid code blocks as SVG diagrams in terminal/browser previews, and as high-quality vector diagrams in PDF export when Mermaid CLI is available$inline$, $$display$$, \(...\), and \[...\] math via MathML with selective MathJax fallback for pandoc-unsupported browser/terminal equations, or native LaTeX (PDF)[an: ...] markers are highlighted in terminal/browser/PDF previews as note-only chips (..., without the [an: ] wrapper) outside code blocks; long notes wrap correctly in PDF instead of running off the page.md, .mdx, .rmd, .qmd), LaTeX .tex files, diff/patch files, or code files (.py, .ts, .js, .rs, etc.) from the filesystem. LaTeX files are rendered as documents with full math and sectioning; diff files are rendered with coloured add/remove lines; code files are rendered with syntax highlighting.r) bypasses cachebrew install pandoc on macOS)/preview default): a Chromium-based browser executable (Chrome, Brave, Edge, Chromium). puppeteer-core is included as an extension dependency; no separate Puppeteer install is needed.brew install --cask mactex on macOS, apt install texlive on Linux)npm install -g @mermaid-js/mermaid-cli) and a Chromium browser accessible to Mermaid CLIpi install npm:pi-markdown-preview
Or from GitHub:
pi install https://github.com/omaclaren/pi-markdown-preview
Or try it without installing:
pi -e https://github.com/omaclaren/pi-markdown-preview
| Command | Description |
|---|---|
/preview | Preview the latest assistant response in terminal |
/preview --pick | Select from all assistant responses |
/preview <path/to/file> | Preview a Markdown, LaTeX, diff, or code file |
/preview --file <path/to/file> | Preview a file (explicit flag) |
/preview --browser | Open preview in default browser |
/preview-browser | Shortcut for browser preview |
/preview-browser <path/to/file> | Open a file preview in browser |
/preview --pdf | Export to PDF and open |
/preview-pdf | Shortcut for --pdf |
/preview --pdf <path/to/file> | Export a file to PDF |
/preview-clear-cache | Clear rendered preview cache |
/preview --pick --browser | Pick a response, open in browser |
Additional accepted argument aliases:
-p, pick-fbrowser, --external, external, --browser-native, nativepdfterminal, --terminal (usually unnecessary because terminal is the default)--help, -h, help--pick and --file cannot be used togetherTo validate command docs against implementation:
npm run check:readme-commands
| Key | Action |
|---|---|
← / → | Navigate pages |
r | Refresh (re-render with current theme) |
o | Open current preview in browser |
Esc | Close preview |
Set PANDOC_PATH if pandoc is not on your PATH:
export PANDOC_PATH=/usr/local/bin/pandoc
Set PANDOC_PDF_ENGINE to override the LaTeX engine used for PDF export (default: xelatex):
export PANDOC_PDF_ENGINE=xelatex
Set PUPPETEER_EXECUTABLE_PATH to override Chromium detection for terminal preview rendering:
export PUPPETEER_EXECUTABLE_PATH=/path/to/chromium
Set MERMAID_CLI_PATH if mmdc is not on your PATH:
export MERMAID_CLI_PATH=/path/to/mmdc
Set MERMAID_PDF_THEME for PDF Mermaid rendering (default, forest, dark, neutral; default: default):
export MERMAID_PDF_THEME=default
Rendered previews are cached at ~/.pi/cache/markdown-preview/. Clear with:
/preview-clear-cache
Or manually:
rm -rf ~/.pi/cache/markdown-preview/
MIT
FAQs
Rendered markdown + LaTeX preview for pi, with terminal, browser, and PDF output
The npm package pi-markdown-preview receives a total of 1,703 weekly downloads. As such, pi-markdown-preview popularity was classified as popular.
We found that pi-markdown-preview demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.