Markdown Viewer - Mermaid, MathJax, TOC & 30 Themes
A fast, private and offline Markdown viewer for Visual Studio Code. It opens a formatted view of your Markdown files beside the editor, updates it while you type and scrolls it with the editor.
Features
- GitHub Flavored Markdown: tables, task lists, strikethrough, autolinks, footnotes, definition lists, abbreviations, highlighted text and GitHub alerts (
> [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING], > [!CAUTION]). Subscript, superscript, inserted text, custom attributes and CJK line breaks can be turned on in the settings.
- Mermaid diagrams: flowcharts, sequence, class, state, Gantt, pie, ER, mindmap, timeline and more. Zoom with
Shift + mouse wheel, drag to pan, copy the source or save the drawing as SVG.
- MathJax formulas:
$...$, $$...$$, \(...\), \[...\] and LaTeX environments, with 33 TeX packages (such as mhchem, physics, cancel) loaded only when a document uses them.
- Syntax highlighting for about 300 languages, each loaded only when it appears in the document, with a copy button and a language badge on every code block.
- Table of contents beside the document, with the section you are reading highlighted. In narrow panels it moves above the document.
- 30 themes for the documents (GitHub light and dark, LaTeX, Sakura, Water, Pico, Simple and many more), plus a VS Code theme that uses the colors of your color theme, light, dark or high contrast. The Select Theme... command shows every theme live while you move through the list.
- Live update while you type and scroll sync with the editor. Double-click a paragraph in the viewer to jump to its line in the source.
- Tables: copy as tab-separated text and HTML (pastes as a table in Excel, Word and Google Docs) or as Markdown; optional column sorting by clicking the headers.
- Images: relative images are shown; click an image to enlarge it, with zoom and pan.
- Links: links to other Markdown files open in the viewer, links to headings scroll to them, other files open in VS Code and web addresses open in your browser.
- Emoji shortcodes such as
:smile: become native emoji, with no download.
- Raw view:
Alt+M shows the Markdown source with syntax colors.
- Six languages: English, Italian, French, German, Spanish and Portuguese.
How to open the viewer
| Where |
How |
| Explorer |
Right-click a Markdown file, then Open in Markdown Viewer |
| Editor |
Right-click inside a Markdown file, then Open Markdown Viewer to the Side |
| Editor tab |
Right-click the tab of a Markdown file, then Open in Markdown Viewer |
| Editor title bar |
Click the book icon of a Markdown file |
| Keyboard |
F9 in a Markdown editor opens the viewer beside it; F9 in the viewer goes back to the source |
| Command Palette |
Markdown Viewer: Open in Markdown Viewer |
Inside the viewer, the title bar has buttons to show the source, show or hide the table of contents and choose a theme. The same actions are in the right-click menu of the viewer.
Commands
| Command |
Default key |
| Markdown Viewer: Open in Markdown Viewer |
|
| Markdown Viewer: Open Markdown Viewer to the Side |
|
| Markdown Viewer: Toggle Between Source and Viewer |
F9 |
| Markdown Viewer: Show Source |
|
| Markdown Viewer: Toggle Raw Markdown |
Alt+M (in the viewer) |
| Markdown Viewer: Toggle Table of Contents |
|
| Markdown Viewer: Select Theme... |
|
| Markdown Viewer: Open Settings |
|
You can change the keys in File > Preferences > Keyboard Shortcuts.
Settings
| Setting |
Default |
Description |
markdownViewer.theme |
vscode |
Theme of the documents (vscode, auto or one of the 30 themes) |
markdownViewer.width |
normal |
Maximum width: normal (880px), wide (1200px), full |
markdownViewer.tableOfContents |
false |
Show the table of contents |
markdownViewer.scrollSync |
true |
Scroll the viewer with the editor |
markdownViewer.openAutomatically |
false |
Open the viewer beside every Markdown file you open |
markdownViewer.language |
auto |
Language of the viewer texts (auto follows VS Code) |
markdownViewer.syntaxHighlighting |
true |
Highlight code blocks |
markdownViewer.mermaid |
true |
Draw Mermaid diagrams |
markdownViewer.math |
true |
Typeset MathJax formulas |
markdownViewer.emoji |
true |
Convert emoji shortcodes |
markdownViewer.headingAnchors |
true |
Link icon beside headings |
markdownViewer.copyButtons |
true |
Copy buttons on code, tables and diagrams |
markdownViewer.codeLanguageBadge |
true |
Language badge on code blocks |
markdownViewer.wrapCode |
false |
Wrap long lines in code blocks |
markdownViewer.imageZoom |
true |
Enlarge images with a click |
markdownViewer.tableSorting |
false |
Sort table columns by clicking the headers |
markdownViewer.markdown.* |
|
HTML, linkify, typographer, line breaks and the Markdown extensions listed above |
markdownViewer.customCss |
|
Your own CSS rules for the viewer |
The titles of commands and settings follow the display language of VS Code; the texts inside the viewer follow markdownViewer.language.
Privacy and security
- Offline: every library, theme and font is inside the extension. The extension never contacts any server and has no telemetry.
- Remote images are not downloaded: an image with a web address is shown as a placeholder with its alternative text and a link to open it in your browser.
- Safe rendering: scripts, event handlers, frames, forms and
javascript: links in documents are removed before display, and a strict Content Security Policy blocks inline code in the viewer.
- Links: only
http, https and mailto links open outside VS Code (VS Code asks for confirmation as usual); other schemes are ignored.
- The extension reads only the Markdown file you open (and the images it shows). It writes a file only when you save a diagram as SVG, where you choose.
Requirements
Visual Studio Code 1.86 or later. Nothing else to install.
Third-party components
markdown-it, Prism, Mermaid, MathJax, Panzoom, github-markdown-css and the themes collected by cleanrmd are bundled with their licenses: see THIRD_PARTY_NOTICES.md.
License
MIT
| |