A lightweight GTK 3 markdown viewer for desktop Linux. It is ideal as your default app for opening .md files. Uses the excellent library md4c for markdown parsing. This project is sort of a companion app/fork of my other markdown project TrayMD.
- Native GTK viewer - No webviews
- Read-only rendering - Focused on viewing markdown files
- Minimal UI - Clean toolbar with open and settings buttons
- Lightweight - Pure C, no web technologies, fast startup
- Hyperlink support - Left click opens links and internal anchors
- Document search -
Ctrl+Fwith next/previous match navigation - Local image support - Local images are resized to fit the document window
- Watch mode -
--watchauto-reloads the file on every save - Editor integration -
--socketopens a Unix socket for live Markdown push with optional scroll-to-line - Stdin support - Pipe content directly with
cat file.md | viewmd -
| Syntax | Description |
|---|---|
# Header 1 |
Large bold header |
## Header 2 |
Medium bold header |
### Header 3 |
Small bold header |
**bold** |
Bold text |
*italic* |
Italic text |
`code` |
Inline code |
|
Code block |
- item |
List item |
> quote |
Block quote |
[text](url) |
Link |
~~strike~~ |
Strikethrough |
| table | row | |
Markdown tables |
--- |
Horizontal rule |
Code blocks currently support a beta version of keyword highlighting for fenced languages c, java, and python.
https://aur.archlinux.org/packages/viewmd
Install a built .deb package with:
sudo apt install ./viewmd_*.debInstall a built .rpm package with:
sudo dnf install ./viewmd-*.rpmRun viewmd to start the application.
- Open button: Open a markdown document
- Reload button: Reload the currently open document from disk
- Settings button: Adjust theme, fonts, and markdown accent colors
viewmd [OPTIONS] [FILE]
| Option | Description |
|---|---|
--watch, -w |
Auto-reload the file whenever it changes on disk |
--socket |
Open a Unix socket for live content push from editors |
- (as FILE) |
Read markdown from stdin (cat file.md | viewmd -) |
viewmd --watch notes.mdThe file is re-rendered within 100 ms of any write. When you open a different file via the toolbar the watch automatically follows.
viewmd --socket file.mdOn startup, ViewMD prints VIEWMD_SOCKET=/tmp/viewmd-<pid>.sock to stdout and listens for connections. An editor plugin can connect, push raw Markdown, and disconnect:
echo "# Hello" | nc -U "$VIEWMD_SOCKET"To also scroll the preview to a specific source line, prefix the payload with CURSOR:<line>\n (0-based):
{ printf 'CURSOR:42\n'; cat file.md; } | nc -U "$VIEWMD_SOCKET"Note: If ViewMD exits unexpectedly the socket file at
/tmp/viewmd-<pid>.sockis left behind. Remove stale sockets withrm /tmp/viewmd-*.sock.
- Press
Ctrl+Fto open search. - Type to highlight matches as you search.
- Press
Enterfor next match andShift+Enterfor previous match. - Press
Escto close search.
After installing, associate markdown MIME types with viewmd.desktop:
xdg-mime default viewmd.desktop text/markdown
xdg-mime default viewmd.desktop text/x-markdownVerify the current default:
xdg-mime query default text/markdownTest by opening a markdown file through your desktop association:
xdg-open README.mdmake
sudo make installThis installs:
- Binary to
/usr/local/bin/viewmd - Desktop file to
/usr/local/share/applications/viewmd.desktop
sudo make uninstallsudo pacman -S gtk3sudo apt install libgtk-3-devsudo dnf install gtk3-devel- Arch:
packaging/arch/PKGBUILD - Debian:
packaging/deb/control.in - RPM:
packaging/rpm/viewmd.spec.in
MIT License
- TrayMD is an app for taking notes in markdown with live editing TrayMD
- Preditor is an image viewer with a similar philosophy to viewmd preditor
- Try my AI panel plugin for XFCE XFCE Ask
- For a feature complete AI application try out ChatGTK
- A lightweight speech to text implementation Auriscribe
- A lightweight local movie database and browser ReelVault
