A lightweight, browser-based markdown viewer with enhanced diagram navigation capabilities. Perfect for viewing documentation with complex Mermaid diagrams that need zooming, panning, and detailed exploration.
- Full GitHub Flavored Markdown (GFM) support
- Syntax highlighting for code blocks
- Tables, lists, blockquotes, and more
- Clean, readable typography
- Interactive Controls: Zoom in/out, pan, reset, and fullscreen for every diagram
- Mouse Wheel Zoom: Scroll to zoom in and out
- Pan & Drag: Click and drag diagrams to navigate
- Reset View: Double-click or use reset button to return to original view
- Fullscreen Mode: Expand diagrams to fill the screen for detailed exploration
- Dark/Light Theme: Automatic theme switching for diagrams
- Drag & Drop: Simply drag markdown files onto the page
- File Browser: Click to browse and select files
- Theme Toggle: Switch between light and dark themes
- Responsive Design: Works on desktop and mobile devices
- Fast & Lightweight: No build step, runs directly in browser
-
Open the App
# Option 1: Open directly in browser open markdown-viewer/index.html # Option 2: Use a local server (recommended) cd markdown-viewer python3 -m http.server 8000 # Then navigate to http://localhost:8000
-
Load a Markdown File
- Drag and drop a
.mdor.markdownfile onto the page - Or click "Browse Files" to select a file
- Drag and drop a
-
Interact with Diagrams
- Use the control buttons in the top-right corner of each diagram:
- + : Zoom in
- - : Zoom out
- ⟲ : Reset view
- ⛶ : Fullscreen mode
- Scroll mouse wheel over diagram to zoom
- Click and drag to pan around large diagrams
- Double-click to reset to original view
- Press ESC to exit fullscreen mode
- Use the control buttons in the top-right corner of each diagram:
ESC- Exit fullscreen mode- Mouse Wheel - Zoom in/out when over a diagram
- Double Click - Reset diagram to original view
- ✅ Chrome 90+ (recommended)
- ✅ Firefox 88+
- ✅ Safari 14+
- ✅ Edge 90+
All modern browsers with ES6+ support and FileReader API.
specdown/
├── README.md # This file
├── docs/
│ └── project-desktop/ # Desktop project history & specs
│ ├── README.md # Start here — overview and timeline
│ ├── 2026-02-20-brainstorm-desktop-electron.md
│ ├── 2026-02-21-spec-desktop-v1.md
│ └── 2026-02-21-tasks-session-01-electron-shell.md
├── markdown-viewer/ # Web app (shared with desktop)
│ ├── index.html # Main application page
│ ├── styles.css # Application styles and theming
│ ├── app.js # Core application logic
│ ├── logo.svg # SpecDown logo (light theme)
│ ├── logo-dark.svg # SpecDown logo (dark theme)
│ ├── favicon.svg # Browser tab icon
│ └── vendor/ # Vendored libraries
├── desktop/ # Electron shell
│ ├── main.js # Main process
│ └── preload.js # IPC bridge stub
├── tests/ # Jest test suite
└── package.json
- Marked.js (v11.1.1) - Markdown parsing
- Mermaid.js (v10.6.1) - Diagram rendering
- Panzoom (v4.5.1) - Interactive pan/zoom functionality
- Highlight.js (v11.9.0) - Code syntax highlighting
- Zero build step required
- Instant setup - just open
index.html - Always up-to-date libraries
- Fast loading from CDN caching
Try the viewer with any .md file containing Mermaid diagrams to explore the interactive features.
Each Mermaid diagram is automatically enhanced with:
-
Control Panel
- Positioned in top-right corner
- Always accessible (not affected by zoom/pan)
- Consistent across all diagrams
-
Zoom Functionality
- Button zoom: 0.2x increments
- Mouse wheel: Smooth, continuous zoom
- Range: 0.5x to 5x (10x in fullscreen)
-
Pan Functionality
- Click and drag anywhere on diagram
- Cursor changes to indicate drag state
- Smooth GPU-accelerated movement
-
Fullscreen Mode
- Darkened backdrop for focus
- Diagram centered and maximized
- Controls remain accessible
- Extended zoom range (up to 10x)
- Click outside or press ESC to exit
- Light Theme: Clean, bright interface for daylight use
- Dark Theme: Easy on the eyes for low-light environments
- Automatic Diagram Theming: Mermaid diagrams adapt to theme
- Persistent Preference: Theme choice saved in browser
- Accepted Formats:
.md,.markdown - Drag & Drop: Anywhere on the drop zone
- File Validation: Checks file extension before loading
- Error Handling: Clear error messages for invalid files
- Memory Management: Cleans up resources when loading new files
Problem: Mermaid diagrams show as code blocks instead of diagrams.
Solution:
- Ensure code blocks are marked with
mermaidlanguage:```mermaid graph TD A --> B ```
- Check browser console for Mermaid syntax errors
Problem: Drag and drop or file selection doesn't work.
Solution:
- Verify file has
.mdor.markdownextension - Try opening in a local server instead of
file://protocol - Check browser console for errors
Problem: Interactive controls don't respond.
Solution:
- Ensure JavaScript is enabled
- Check that diagram rendered successfully (no error messages)
- Try refreshing the page
- Verify browser compatibility
Problem: Theme resets to light on page reload.
Solution:
- Enable localStorage in browser settings
- Check that cookies/storage aren't being cleared
- Try incognito/private mode to test
- Documents with many diagrams load sequentially
- Scroll to diagram to trigger panzoom initialization (lazy loading)
- Consider splitting very large documents
- Use fullscreen mode for detailed exploration
- Reset view if performance degrades
- Simplify diagram if rendering is slow
Download the latest .dmg from GitHub Releases.
Note: The app is unsigned. On first launch, right-click the app and select Open to bypass Gatekeeper. Alternatively, run
xattr -cr /Applications/Specdown\ Desktop.appafter installing.
- Open the downloaded
.dmg - Drag Specdown Desktop to your Applications folder
- Right-click > Open on first launch
The release pipeline is fully automated. Every merge to main triggers the following sequence:
- Version Bump -- The "Bump version on merge" workflow runs
npm version patch, creating a new version commit and git tag (e.g.,v0.0.46), then pushes both tomain. - DMG Build -- The "Build Desktop App" workflow detects the version bump, checks out the tagged code on a macOS runner, and runs
npm run desktop:buildto produce a.dmg. - GitHub Release -- The DMG is uploaded to a GitHub Release matching the new tag. The release is created automatically if it does not already exist.
- Web Deploy -- Simultaneously, the "Deploy static content" workflow deploys the latest web app to GitHub Pages.
Go to the repository's Releases page and download the .dmg file from the latest release.
If the automated build did not run (or you need to rebuild):
- Go to Actions > Build Desktop App in the repository.
- Click Run workflow and select the
mainbranch. - The workflow will build a DMG and attach it to the most recent tag's release.
npm install
npm run desktop:build # produces a .dmg in dist/First-time setup:
cd specdown # navigate into the project directory
npm install # install Electron and all dependenciesLaunch the app:
npm run desktop # opens the Specdown Desktop windowBuild the DMG locally (macOS only):
npm run desktop:build # produces a .dmg in dist/Requires Node.js (v18+) installed on your machine.
npm testRuns the full Jest test suite (unit + integration). All tests must pass before committing.
- Styling: Edit
markdown-viewer/styles.cssfor visual changes - Functionality: Edit
markdown-viewer/app.jsfor behavior changes - Structure: Edit
markdown-viewer/index.htmlfor layout changes - Electron main process: Edit
desktop/main.js - IPC bridge: Edit
desktop/preload.js
The codebase is organized into clear sections:
// app.js structure
- Global State
- DOM Elements
- Initialization
- Theme Management
- Event Listeners
- Drag and Drop Handlers
- File Processing
- Markdown/Mermaid Configuration
- Rendering Logic
- Panzoom Initialization
- Fullscreen Management
- Cleanup FunctionsTo add more syntax highlighting languages:
<!-- Add to index.html -->
<script src="https://cdn.jsdelivr.net/npm/highlight.js@11.9.0/lib/languages/rust.min.js"></script>This is a self-contained application. To improve:
- Fork or copy the directory
- Make your changes
- Test in multiple browsers
- Share improvements!
This project uses open-source libraries:
- Marked.js - MIT License
- Mermaid.js - MIT License
- Panzoom - MIT License
- Highlight.js - BSD 3-Clause License
Built for viewing documentation with complex system architecture diagrams.
- Initial release
- Full markdown rendering
- Interactive mermaid diagrams
- Zoom, pan, reset, fullscreen
- Dark/light theme support
- Drag & drop file loading
For issues or questions:
- Check the Troubleshooting section
- Verify browser compatibility
- Check browser console for error messages
- Test with example files to isolate the issue
Happy Diagram Viewing with SpecDown! 📊