Skip to main content

mdview

A Markdown viewer and editor with live preview, for macOS, Windows and Linux. It has two interfaces that share one renderer:

  • a graphical UI in a native window, and
  • a terminal UI for use in a shell or over SSH.

Published on PyPI as dvm-mdview.

Run it

With uv installed, nothing else needs installing:

uvx dvm-mdview README.md
uvx dvm-mdview --tui README.md

Or install it, which gives you the shorter mdview command:

uv tool install dvm-mdview
mdview notes.md
Option Effect
(none) Graphical UI. Falls back to the terminal UI when there is no display.
-t, --tui Terminal UI.
-b, --browser Graphical UI in your default browser instead of a native window.
-e, --edit Start with editor and preview side by side.
-r, --read Start with the preview only.

A file that does not exist yet is opened empty and created when you save. Passing a folder opens its README.md.

Features

  • Live preview. View, Split (editor and preview side by side) and Edit layouts. The preview updates as you type.
  • Link navigation. Links to other Markdown files open in place, with back and forward history. Links to headings scroll to them. Web links open in your browser. A link to a file that does not exist starts a new document at that path.
  • Markdown. CommonMark with GitHub tables, task lists, strikethrough and autolinks, plus footnotes, YAML front matter and heading anchors.
  • Code highlighting in both interfaces.
  • Mermaid diagrams and LaTeX math rendered in the graphical UI (shown as source in the terminal). Both work offline; the libraries are bundled.
  • Safe saving. Files are written atomically, you are asked before unsaved changes are lost, and a file changed by another program is reloaded (or flagged, if you have edits of your own).
  • Outline sidebar, light and dark themes, and relative images in the graphical UI.

Keys

Graphical UI

Cmd replaces Ctrl on macOS.

Key Action
Ctrl+E Cycle View / Split / Edit
Ctrl+S, Ctrl+Shift+S Save, Save as
Ctrl+O, Ctrl+N Open, New
Alt+Left, Alt+Right Back, Forward
Ctrl+B, Ctrl+I, Ctrl+K Bold, italic, link

Terminal UI

Key Action
Ctrl+E Cycle View / Split / Edit
F6 Switch between editor and preview
Ctrl+S Save
Ctrl+O Open
Ctrl+L List the document's links and follow one
Alt+Left, Alt+Right Back, Forward
Ctrl+P Command palette (Save as, New, theme, ...)
Ctrl+Q Quit

Links can also be clicked with the mouse. While the preview has focus, single keys work too: e edit, l links, o open, b back, f forward, j/k scroll, q quit.

How it is built

Part Library
Markdown parsing markdown-it-py and mdit-py-plugins
Code highlighting Pygments
Native window pywebview (WebKit on macOS, WebView2 on Windows)
Terminal UI Textual
Diagrams and math Mermaid and KaTeX, bundled

The graphical UI is a small web app served by a local backend (src/mdview/server.py) that listens only on 127.0.0.1 and requires a per-run secret token. Raw HTML in a document is displayed, but a strict Content-Security-Policy stops any script in it from running.

On Linux a native window needs GTK or Qt bindings for pywebview; without them mdview uses the browser automatically.

Development

uv sync
uv run pytest
uv run mdview README.md

Releasing

The version comes from the git tag, so the tag and the PyPI version always match.

  1. Once, on pypi.org, add this repository as a trusted publisher for dvm-mdview (workflow publish.yml, environment pypi).
  2. Tag a commit on main and push the tag:
git tag v1.2.3
git push origin v1.2.3

The Release workflow builds version 1.2.3, creates the GitHub release and uploads to PyPI.

License

MIT. Bundled Mermaid and KaTeX are MIT licensed; their licences are in src/mdview/web/vendor/.

Metadata

Release files for dvm-mdview 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dvm-mdview 0.1.0
File Size Uploaded Provenance Actions
dvm_mdview-0.1.0.tar.gz 2.0 MB Without provenance Details for dvm_mdview-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dvm-mdview 0.1.0
File Interpreter ABI Platform Actions
dvm_mdview-0.1.0-py3-none-any.whl Python 3 none any Details for dvm_mdview-0.1.0-py3-none-any.whl

Total release size: 4.0 MB

Release files / dvm_mdview-0.1.0.tar.gz

Download URL dvm_mdview-0.1.0.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
86fbcf6216cf15548fb154a8a14f53191ddc7aa7898a94322b57c820627d3c00
BLAKE2b-256 checksum
How to use checksums
6bdcf3e57d6315895df1513d08dd0bb3957a428957fd35314284242490aaf94d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / dvm_mdview-0.1.0-py3-none-any.whl

Download URL dvm_mdview-0.1.0-py3-none-any.whl
Size 2.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
598fc68cb0c61a8c60a42048e2e4f93b1b75ea72949cb214c3bdb508b642fce5
BLAKE2b-256 checksum
How to use checksums
322e44445fbd1c343132a9d882dbb49d731db829d9a79e6939c4d3dd493a4a72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for dvm-mdview 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page