A clean, modern documentation viewer for Markdown files. Perfect for software specifications, technical documentation, and project wikis.
- Collapsible folder sections - Organize docs by category
- Natural sorting - Files with numeric prefixes (1.0, 1.1, 2.0, 3.1, 3.2) sort correctly
- Smart ordering - Semantic versioning and numeric prefixes handled intelligently
- Logo/branding - Customizable site title
- Section dropdowns - Quick access to document categories
- Search box - Fast full-text search across all docs
- Dark/light mode toggle - Persistent theme preference
- Instant search - Search across all document titles and content
- Keyboard shortcut - Press
/to focus the search box - Smart results - Shows document title and context snippet
- ESC to close - Quick dismissal of search results
- Clean typography - Optimized for readability
- Syntax highlighting - Code blocks with highlight.js
- Table of contents - Right-side TOC with "In This Article" header
- Scroll spy - TOC highlights current section as you scroll
- Nested subsections - Properly indented TOC hierarchy
- Bordered tables - Clean, professional appearance
- Alternating rows - Subtle zebra striping for readability
- Hover effects - Interactive table rows
- Proper spacing - Optimized padding and alignment
- Previous/Next links - Navigate sequentially through docs
- Smart ordering - Based on sidebar organization
- Clear labels - Shows document titles for context
- Edit links - "Edit this page" button at bottom of each doc
- Configurable source directory - Point to any docs folder
- Brand colors - Easy CSS customization
git clone https://github.com/adamdaigian/spec-viewer.git
cd spec-viewerSet the DOCS_DIR environment variable to point to your documentation folder:
export DOCS_DIR=/path/to/your/docsOr create a .env file:
DOCS_DIR=/path/to/your/docs
npm install
npm startOr use the convenient start script:
chmod +x start.sh
./start.shNavigate to http://localhost:3334
DOCS_DIR- Path to your documentation directory (required)PORT- Server port (default: 3334)
The viewer automatically scans your docs directory and organizes files:
docs/
├── README.md # Shows in "Overview" section
├── MASTERSPEC.md # Priority ordering
├── docs/ # Folder becomes "Docs" section
│ ├── 1.0-intro.md # Natural sorting: 1.0 < 1.1 < 2.0
│ ├── 1.1-setup.md
│ └── 2.0-advanced.md
└── guides/ # Folder becomes "Guides" section
├── quick-start.md
└── deployment.md
Edit index.html and update the logo/title:
<a href="#" class="nav-logo">△ Your Project Name</a>Edit the CSS variables in index.html:
:root {
--accent-color: #5A7B8F; /* Primary brand color */
--accent-hover: #2C4A5A; /* Hover state */
/* ... more variables */
}Edit server.mjs and update the EXCLUDE_DIRS array:
const EXCLUDE_DIRS = ['node_modules', '.git', 'drafts'];Inspired by GitHub Spec Kit - a beautiful docs viewer with clean navigation and modern UX.
- Zero dependencies for the viewer (just vanilla JS)
- Node.js for the server
- marked.js for Markdown parsing
- highlight.js for syntax highlighting
- No build step - just clone and run
- Full-text search with better relevance scoring
- Mobile-responsive hamburger menu
- PDF export for individual docs
- Dark/light code theme sync
- Markdown TOC generation in files
- Multi-language support
- Custom footer links
- Analytics integration
Pull requests welcome! Please:
- Test your changes locally
- Keep the zero-dependency viewer approach
- Maintain compatibility with existing doc structures
MIT License - see LICENSE file
Created by Adam Daigian
Originally built for Northstar documentation.