Package Exports
- moremaid
- moremaid/mm.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (moremaid) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Moremaid
A powerful Markdown viewer with full Mermaid diagram support. View your markdown files with beautifully rendered diagrams, syntax-highlighted code blocks, and a clean reading experience.
Features
- ๐จ Mermaid Diagram Rendering - Full support for flowcharts, sequence diagrams, Gantt charts, and more
- ๐ฅ๏ธ Syntax Highlighting - Code blocks with syntax highlighting for 20+ languages via Prism.js
- ๐ญ 10 Color Themes - Choose from Light, Dark, GitHub, Dracula, Nord, Solarized, Monokai, and more
- ๐ Smart Theme UI - Theme selector appears on hover in top-right corner
- ๐ Folder Mode - Browse entire directories of markdown files with built-in HTTP server
- ๐ฆ Archive Support - Pack and share markdown projects as
.moremaidfiles with optional encryption - ๐ Full-Text Search - Search within file contents with context snippets and highlighting
- โจ๏ธ Keyboard Navigation - Use TAB to toggle search modes, arrow keys to navigate results
- ๐ฏ Smart Search - Fuzzy matching, prefix search, and relevance ranking
- ๐ฑ Responsive Design - Clean, readable layout that works on any screen size
- ๐ Bookmarkable URLs - Direct links to specific files (server mode)
- ๐ผ๏ธ Fullscreen Diagrams - Click to open Mermaid diagrams in a new window
- ๐งน Auto-Cleanup - Temporary files cleaned up automatically when viewing archives
- ๐ Zero Config - Works out of the box with sensible defaults
Installation
Command-Line Tool
Option 1: Global Installation
npm install -g moremaid
mm your-file.mdOption 2: Local Installation
git clone https://github.com/yourusername/moremaid.git
cd moremaid
npm install
./mm.js your-file.mdOption 3: Using npx (no installation)
npx moremaid your-file.mdUsage
Command-Line Tool (Single File)
Convert any markdown file to HTML and open it in your browser:
mm README.md
mm docs/api-documentation.md
mm ~/notes/meeting-notes.md
# With theme selection
mm README.md --theme github
mm file.md -t dracula
mm file.md --dark # Shortcut for --theme darkArchive Mode (.moremaid Files)
Pack and share your markdown projects:
# Pack a directory into a .moremaid archive
mm --pack myproject/
mm --pack README.md # Pack a single file
mm --pack docs/ --theme github # Pack with default theme
# View a .moremaid archive
mm project.moremaid # Opens archive in browser
mm shared.zip # Also supports regular .zip filesArchive features:
- Password Protection - Optional AES-256 encryption for sensitive documents
- Self-Contained - All markdown files packed into a single shareable file
- Auto-Cleanup - Server automatically shuts down when browser closes
- Instant Navigation - Single WebSocket connection for all files
Available command-line options:
mm [options] <markdown-file-or-folder-or-archive>
Options:
-h, --help Show help message
-v, --version Show version number
-d, --dark Start in dark mode (shortcut for --theme dark)
-t, --theme <name> Select color theme:
light, dark, github, github-dark, dracula,
nord, solarized-light, solarized-dark,
monokai, one-dark
-p, --pack Pack files into .moremaid archiveThe tool:
- Generates a standalone HTML file with all assets embedded
- Opens it in your default browser automatically
- Cleans up the temporary file after viewing
- Supports theme selection via command-line flags
Folder Mode (Directory Browser)
Browse all markdown files in a directory with a built-in server:
mm . # Current directory
mm docs # Specific folder
mm ~/projects/docs # Any folder path
PORT=3000 mm samples # Custom portFolder mode features:
- Starts local HTTP server (automatically finds free port)
- Recursively finds all markdown files
- Interactive index page with file navigation
- Full-text search across all markdown files
- Context snippets showing text around matches
- Keyboard shortcuts for efficient navigation
- Click files to view them with full rendering
- Back navigation on file pages
- Graceful shutdown with Ctrl+C
Search Features
When in folder mode, you can:
- Search filenames - Default mode, searches in file and folder names
- Search contents - Toggle with checkbox or TAB key to search within files
- View snippets - See context around matches with highlighting
- Navigate results - Use arrow keys to browse, Enter to open
Keyboard shortcuts:
/- Focus search fieldTAB- Toggle between filename/content search (when focused)โโ- Navigate search resultsEnter- Open selected fileESC- Clear search and unfocus
Color Themes
Moremaid includes 10 beautiful color themes:
- Light - Clean, bright theme for daytime reading
- Dark - Easy on the eyes for night-time viewing
- GitHub - Familiar GitHub markdown styling
- GitHub Dark - GitHub's dark mode theme
- Dracula - Popular dark theme with vibrant colors
- Nord - Arctic, north-bluish color palette
- Solarized Light/Dark - Precision colors for machines and people
- Monokai - Classic developer theme
- One Dark - Atom's iconic dark theme
Themes can be:
- Selected via command-line:
mm file.md --theme dracula - Changed interactively by hovering over the top-right corner
- Persisted in browser's localStorage
- System preference aware (uses dark mode if system prefers it)
Mermaid Diagram Support
Moremaid renders all types of Mermaid diagrams:
Flowchart
graph TD
A[Start] --> B{Is it working?}
B -->|Yes| C[Great!]
B -->|No| D[Fix it]
D --> BSequence Diagram
sequenceDiagram
Alice->>John: Hello John
John-->>Alice: Hi Alice
Alice->>John: How are you?
John-->>Alice: Great!Gantt Chart
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Phase 1
Task 1 :a1, 2024-01-01, 30d
Task 2 :after a1, 20d
section Phase 2
Task 3 :2024-02-01, 12d
Task 4 :24dClick the โถ button on any diagram to open it fullscreen in a new window.
All diagrams automatically adapt to your selected color theme for consistent styling.
Syntax Highlighting
Code blocks are automatically highlighted with support for:
- JavaScript/TypeScript
- Python
- Java, C++, C#
- Go, Rust, Swift
- Ruby, PHP
- SQL, YAML, JSON
- Docker, Shell scripts
- And many more...
Example:
def hello_world():
print("Hello, Moremaid!")
return TrueProject Structure
moremaid/
โโโ mm.js # CLI tool entry point
โโโ package.json # NPM package configuration
โโโ samples/ # Example markdown files
โโโ README.md # This fileRequirements
CLI Tool
- Node.js 14.0.0 or higher
- NPM (comes with Node.js)
Browser Support
- Any modern browser (Chrome, Firefox, Safari, Edge)
- JavaScript must be enabled
How It Works
CLI Tool (Single File)
- Reads the markdown file
- Converts to HTML using
markedlibrary - Processes Mermaid code blocks
- Embeds all CSS and JavaScript inline
- Creates a temporary HTML file
- Opens it in your default browser
- Cleans up after 5 seconds
CLI Tool (Folder Mode)
- Scans directory recursively for markdown files
- Starts HTTP server on available port
- Generates index page with file listing
- Serves markdown files on demand
- Renders with same quality as single-file mode
- Handles navigation between files
Development
Building from Source
# Clone the repository
git clone https://github.com/yourusername/moremaid.git
cd moremaid
# Install dependencies
npm install
# Run locally
./mm.js test.md
# Run tests (when available)
npm testContributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
MIT License - see LICENSE file for details
Comparison with Alternatives
| Feature | Moremaid | GitHub | VSCode | Typora |
|---|---|---|---|---|
| Mermaid Support | โ Full | โ Full | โ ๏ธ Extension | โ Full |
| Color Themes | โ 10+ | โ 2 | โ Many | โ Several |
| Full-Text Search | โ Yes | โ Limited | โ Yes | โ Yes |
| Context Snippets | โ Yes | โ No | โ Yes | โ No |
| Offline Usage | โ Yes | โ No | โ Yes | โ Yes |
| CLI Tool | โ Yes | โ No | โ No | โ No |
| Web Server | โ Yes | โ N/A | โ ๏ธ Extension | โ No |
| Free | โ Yes | โ Yes | โ Yes | โ Paid |
| Bookmarkable | โ Yes | โ Yes | โ No | โ No |
| No Installation* | โ Yes | โ Yes | โ No | โ No |
* For viewing markdown files using npx
Troubleshooting
CLI Tool Issues
Error: "mm: command not found"
- Make sure you've installed globally with
npm install -g - Or use
npx moremaidinstead - Or run directly with
./mm.js
Browser doesn't open automatically
- The HTML file is saved to your temp directory
- Look for the path in any error message
- Open the file manually if needed
Server Issues
Port already in use
- The folder mode automatically finds an available port
- Use
PORT=3000 mm .to specify a custom port
Rendering Issues
Mermaid diagrams not rendering
- Ensure JavaScript is enabled in your browser
- Check browser console for any error messages
- Try refreshing the page
Code highlighting not working
- Some language aliases might not be recognized
- Try using the full language name (e.g.,
javascriptinstead ofjs)
Acknowledgments
- Marked - Markdown parser and compiler
- Mermaid - Diagram and flowchart generator
- Prism.js - Syntax highlighter
Support
For bugs, questions, and discussions please use the GitHub Issues.
Made with โค๏ธ for the Markdown community