Light MD Reader
A distraction-free reading view for Markdown files in VS Code. Right-click a .md file → Open in Light MD Reader.

| Night theme |
Focus mode (Sepia) |
Reading settings |
 |
 |
 |
Installation
Install Light MD Reader from the VS Code Marketplace: open the Extensions view
(Ctrl+Shift+X, on macOS Cmd+Shift+X), search for Light MD Reader and click Install.
Or from the terminal:
code --install-extension vvedran.light-md-reader
Requires VS Code 1.80 or newer.
Building from source
You need Node.js 18 or newer.
git clone https://github.com/vvedran/md-reader.git
cd md-reader
npm install
npm run package
code --install-extension light-md-reader-<version>.vsix
Usage
Open a Markdown file in the reader in any of these ways:
- Right-click the file in the Explorer, in the editor, or on its tab → Open in Light MD Reader
- The book icon in the editor title bar
Ctrl+Alt+M while a Markdown file is focused
- Command Palette → Light MD Reader: Open in Light MD Reader
| Button |
What it does |
| ☰ |
Table of contents; highlights the section you are reading |
| A− / A+ |
Text size |
| ⚙ |
Reading settings: theme, font, size, line height, column width, justify |
| ◎ |
Focus mode: dims everything except the paragraph you are reading |
| ⤓ |
Export to HTML or PDF |
| ✎ |
Open the source file at the spot you are reading |
Keyboard shortcuts (inside the reader)
| Key |
Action |
T |
Toggle table of contents |
F |
Toggle focus mode |
Esc |
Close popup / image / focus mode |
Ctrl+F |
Search in the document |
Ctrl+= / Ctrl+- |
Bigger / smaller text |
Features
- Book-like typography; themes Auto (follows VS Code) / Paper / Sepia / Night
- Any installed font (Settings → Font → Custom)
- Mermaid diagrams, KaTeX math, GitHub alerts (
> [!NOTE], > [!WARNING], …), task lists
- Copy button on code blocks, click an image to zoom
- Remembers where you stopped reading in each file
- Live updates while you edit the file
- Relative links to other
.md files open in the reader
- Export to HTML or PDF
Settings
| Setting |
Description |
mdReader.browserPath |
Path to Chrome/Chromium/Brave/Edge for PDF export. Empty = auto-detect. |
PDF export needs one of those browsers installed. HTML export works without it.
Security
Markdown files can contain raw HTML, so the reader treats every document as untrusted:
- All HTML is cleaned with DOMPurify before it is shown: scripts, event handlers (
onerror, …), javascript: URLs, iframes, forms and similar are removed.
- A strict Content Security Policy only allows the extension's own scripts.
- Links only open for
http, https and mailto. command:, vscode:, file: and other schemes are blocked.
- Mermaid runs in
strict mode (no click handlers or HTML labels).
- Exported HTML and PDF files contain no scripts.
Remote images (https://…) are still loaded, so the image server can see that the document was opened.
Development
npm install
npm test # export unit tests, headless UI tests, tests inside VS Code
npm run package # builds light-md-reader-<version>.vsix
npm run screenshots # regenerates docs/screenshots from docs/demo.md
npm test opens a VS Code window for a few seconds and uses the locally installed
VS Code (/usr/share/code/code, see test/run.js) and a Chromium-based browser.