A beautiful, real-time markdown viewer with live reload support. Edit your markdown files and see changes instantly in your browser!
- 🎨 Beautiful GitHub-inspired styling
- ⚡ Live reload - changes appear instantly without manual refresh
- 🔍 Syntax highlighting for code blocks (Java, Bash, and more)
- 🔗 Working table of contents with smooth scroll
- 📱 Responsive design
- 🎯 Accepts any markdown file as input
npm install -g markdown-live-viewerThis installs the mdview command globally, making it available from anywhere on your system!
# View any markdown file
mdview /path/to/your/file.md
# View from current directory
mdview README.md
# Examples
mdview ~/Documents/my-notes.md
mdview ./README.md
mdview ../docs.md
mdview documentation.md- Start the server - Point it to your markdown file
- Open browser - Navigate to http://localhost:8080
- Edit markdown - Make changes to your markdown file
- Watch updates - Changes appear instantly in the browser!
The green "Live" indicator in the top-right shows the connection status.
- Uses WebSocket for instant updates
- Preserves scroll position when content updates
- Shows connection status indicator
- GitHub Dark theme for code blocks
- Supports Java, Bash, and many other languages
- Syntax highlighting applies automatically
- All headings get automatic IDs
- Table of contents links work perfectly
- Smooth scrolling to sections
- Clean, professional appearance
- Maximum width of 1400px for readability
- Responsive design for mobile devices
By default, the server runs on port 8080. You can change it:
PORT=3000 mdview ../docs.mdGood news! You can run multiple instances simultaneously. The tool automatically detects if a port is in use and tries the next available port (8081, 8082, etc.).
# Terminal 1
mdview doc1.md # Runs on port 8080
# Terminal 2
mdview doc2.md # Automatically runs on port 8081
# Terminal 3
mdview doc3.md # Automatically runs on port 8082Each instance watches its own file and runs independently!
Press Ctrl+C to stop the server gracefully.
npm uninstall -g markdown-live-viewerConnection Lost: If you see a red "Disconnected" indicator, the server may have stopped. Restart it.
File Not Found: Make sure the markdown file path is correct. The tool shows the full path it's watching when it starts.
Port Already in Use: Change the port using the PORT environment variable.
- Node.js (v14 or higher)
- npm
- express - Web server
- marked - Markdown parser
- ws - WebSocket support
- chokidar - File watching
- highlight.js - Syntax highlighting (CDN)
Want to contribute or run locally?
# Clone the repository
git clone https://github.com/yourusername/markdown-live-viewer.git
cd markdown-live-viewer
# Install dependencies
npm install
# Link for local development
npm link
# Run directly
node server.js /path/to/your/file.md