This guide takes a clean checkout to a live preview. It covers the installed
vv launcher, the development run path, opening files, live refresh, tabs,
history, search, themes, and the Contents panel.
What vinary-viewer is. vinary-viewer is a local-first Electron previewer for GitHub-Flavored Markdown and related repository resources. The renderer is a ClojureScript re-frame application; the Electron main process owns file IO, native views, configuration, and watchers.
| Tool | Why it is needed | Check |
|---|---|---|
Node.js with npm and npx |
Installs JavaScript dependencies and runs Electron/shadow-cljs scripts. | node --version |
| JDK | Runs the shadow-cljs compiler. |
java -version |
| git | Provides the sidebar file tree through git ls-files. |
git --version |
The JDK is only the compiler runtime; you do not write Java for this project.
From the repository root:
./install.sh
vv README.md./install.sh performs three actions:
- Runs
npm install --no-fund --no-audit. - Builds the
mainandrenderershadow-cljs targets. By default it runs a release build; useVV_BUILD=compile ./install.shfor a development build. - Installs
vinary-viewerand the shortvvsymlink into~/.local/bin.
Override the launcher directory with:
BIN=/path/to/bin ./install.shRemove only the launchers with:
./uninstall.shThe repository and ~/.config/vinary-viewer/ are left intact.
During development you can skip launcher installation:
npm run devnpm run dev expands to:
shadow-cljs compile main renderer
electron .
For a tighter edit loop, run the compiler watcher and Electron separately:
npm run watch
npm run startYou can also pass an initial file through Electron:
npm run start -- README.md
electron . README.mdThe launcher forwards arguments to Electron, so the normal command is:
vv docs/usage/01-getting-started.mdWhat happens:
- The main process extracts the first non-flag argument from
process.argv. - The main process reads the file, classifies it, and sends
vv:contentto the renderer through thewindow.vvpreload mediator. - The renderer caches document content in DataScript.
- Markdown is rendered asynchronously through unified/remark/rehype and stores
:doc/html,:doc/toc, and:doc/assets. - The tab/history state in re-frame
app-dbpoints the active tab at the file. - The main process starts watching every retained local file path.
Diagram source: ../diagrams/seq-open-file.puml.
With a Markdown file open, edit it in your normal editor and save. The preview updates without replacing tab state, scroll state, keybinding state, or sidebar state.
For a quick terminal check:
printf '\n## Live edit demo\n\nHello from a live edit.\n' >> README.mdThe watcher uses chokidar with awaitWriteFinish and listens for both
change and add, so ordinary saves and common atomic-save patterns both
refresh.
Open another local file from the sidebar, from the menu, or from a Markdown link. Each tab has its own browser-like history stack. Back/Forward restores both the target document and the saved scroll position for that history entry.
Useful defaults:
| Action | Input |
|---|---|
| Back | Alt+Left, toolbar Back, or mouse back button |
| Forward | Alt+Right, toolbar Forward, or mouse forward button |
| Open link in active tab | left-click |
| Open link in new tab | Ctrl+click |
Press Ctrl+F, type a query, then use Enter and Shift+Enter to move through
matches. Esc closes the find bar. The implementation uses the browser's CSS
Custom Highlight API, so it does not inject marker spans into rendered Markdown.
Use Settings > Theme to switch between bundled themes. Use
Settings > Preferences... for variable-width and fixed-width font settings.
Selections persist to ~/.config/vinary-viewer/settings.edn.
Markdown rendering records heading metadata during the HAST traversal, stores it
as :doc/toc, and the Contents panel uses cached heading offsets for scroll-spy.
Embedded SVG sizing completes before the first offset refresh so the active
heading does not flicker while large diagrams settle.
| Kind | Extensions or source | Preview |
|---|---|---|
| Markdown | .md, .markdown, .mdx |
Rendered GFM with slugged headings, code highlighting, MathJax SVG math, inline Mermaid diagrams, TOC metadata, and asset tracking. |
| Org | .org |
Emacs Org-mode rendered GitHub-style through the same pipeline, with a Contents outline and highlighted #+begin_src blocks. |
| LaTeX | .tex, .latex, .ltx |
.tex rendered as a formatted document (sections, styling, tables, figures, math, code) via unified-latex; .sty/.cls/.bib stay source. |
| Image | .png, .jpg, .jpeg, .gif, .svg, .webp, .bmp, .ico, .avif |
Browser image preview from the local file URL. |
.pdf |
Rendered in the renderer via pdf.js (ADR-0013): each page draws to a <canvas> inside the content pane as it scrolls into view. See ../features/11-native-pdf.md. |
|
| Mermaid | .mmd, .mermaid |
Renderer-side Mermaid SVG preview with live refresh. |
| Diff | .diff, .patch |
Colored unified diff, with a side-by-side split view available. |
| Source | Known source files, configured filetype mappings, and non-Mermaid diagram-source extensions | Read-only CodeMirror 6 view with tree-sitter highlighting when a grammar is available. |
| Text | Fallback | Escaped preformatted text. |
| Directory | Any folder path | In-pane directory browser listing the immediate children. |
Diagram source files such as .puml, .d2, and .dot open as source code;
Mermaid source files render directly. Files on a remote host open the same way
through ssh:// / sftp:// URIs — see 08-remote-files-ssh.md.
The same documents can also be previewed in the terminal with vv --cli /
vv --tui — see 07-terminal-cli-tui.md.
| If you want to... | Read |
|---|---|
| Understand build modes and artifacts | 02-installation-and-build.md |
| Learn file opening and tab behavior | 03-opening-files-and-tabs.md |
| See the keybinding system | 04-keyboard-shortcuts.md |
| Configure settings and grammars | 05-configuration.md |
| Diagnose a problem | 06-troubleshooting.md |
| Preview documents in the terminal (CLI/TUI) | 07-terminal-cli-tui.md |
| Open remote files over SSH | 08-remote-files-ssh.md |
| Understand the architecture | ../architecture/01-overview.md |
Next: 02-installation-and-build.md.