A simple CLI tool that serves markdown files as HTML with beautiful Tailwind CSS styling and automatic dark/light theme support.
This project was vibe coded with AI pair programming!
Seemingly you only vibe code if you don't review anything and let the agents
do all the work. So this is probably less vibe coded and I am just too lazy to write
these simple things manually anymore. But there might still be AI slop lingering as
I use this script, but it's low to non-existent stakes.
- π Fast & Lightweight: Built with Express.js
- π¨ Beautiful Styling: Uses Tailwind CSS with typography plugin
- π Dark/Light Mode: Automatic theme switching based on system preferences
- π Directory Listing: Automatically lists all markdown files in the directory
- π Smart URLs: Access files with or without the
.mdextension - π± Responsive: Works great on desktop and mobile devices
- π» Syntax Highlighting: Code blocks with Prism.js (light/twilight themes)
- π― Minimal UI: Clean, distraction-free reading experience
# Add the tap
brew tap pders01/md
# Install the CLI
brew install md-server# Clone the repository
git clone https://github.com/pders01/md.git
cd md
# Install dependencies
pnpm install
# Build the CLI
pnpm run buildFor easy development and testing, you can create a global symlink:
# From the project directory
pnpm link
# Now you can run from anywhere
md-server --port 3000Or use the provided install script:
# Run the install script (requires sudo)
./scripts/install.shOr create a manual symlink:
# Create a symlink to the built CLI
ln -s "$(pwd)/dist/index.js" /usr/local/bin/md-server
# Make it executable
chmod +x /usr/local/bin/md-server
# Now you can run from anywhere
md-server --port 3000To uninstall, run: sudo rm /usr/local/bin/md-server or use ./scripts/uninstall.sh
# Start with default settings (port 3000, current directory)
md-server
# Custom port and directory
md-server --port 8080 --directory ./docs-p, --port <port>: Port to run the server on (default: 3000)-d, --directory <dir>: Directory to serve markdown files from (default: current directory)-h, --host <host>: Host to bind the server to (default: localhost)
# Serve markdown files from current directory
md-server
# Serve from a specific directory
md-server --directory ./my-docs
# Use a different port
md-server --port 8080Once the server is running, you can access your markdown files at:
http://localhost:3000/- Directory listinghttp://localhost:3000/README.md- View README.mdhttp://localhost:3000/README- Same as above (extension optional)
The server supports all standard markdown features with enhanced styling:
- Unordered list item 1
- Unordered list item 2
- Nested item
- Another nested item
- Ordered list item 1
- Ordered list item 2
- Ordered list item 3
Inline code: console.log('Hello, World!')
// Code block with syntax highlighting
function greet(name) {
return `Hello, ${name}!`;
}| Feature | Description | Status |
|---|---|---|
| Markdown Support | Full markdown parsing | β |
| Tailwind Styling | Beautiful, responsive design | β |
| Dark/Light Mode | Automatic theme switching | β |
| Syntax Highlighting | Prism.js with light/twilight themes | β |
| Directory Listing | Auto-generated file index | β |
| CLI Interface | Easy command-line usage | β |
This is a blockquote. It can contain multiple lines and is styled with a left border.
md/
βββ cli.js # CLI entry point
βββ src/
β βββ server.js # Express server logic
β βββ styles/
β βββ tailwind.css # Tailwind source styles
βββ public/
β βββ styles.css # Custom styles
β βββ template.html # HTML template
β βββ tailwind.css # Built Tailwind CSS
β βββ prism.js # Syntax highlighting
β βββ prism-light.css # Light theme
β βββ prism-dark.css # Dark theme (twilight)
βββ tailwind.config.js # Tailwind configuration
βββ vite.config.js # Vite configuration
βββ package.json # Dependencies and scripts
# Build CSS
pnpm run build:css
# Watch for CSS changes
pnpm run watch
# Start development server
pnpm run dev- express: Web server framework
- marked: Markdown parser
- commander: CLI argument parsing
- chalk: Terminal color output
- prismjs: Syntax highlighting
- tailwindcss: Styling framework
- @tailwindcss/typography: Typography plugin
- vite: Bundler for development and production
For more detailed information, see:
- Developer Guide - Development setup, project structure, and contribution guidelines
- Markdown Features - Complete demonstration of all supported markdown features
You can install md-server directly from the official Homebrew tap:
brew tap pders01/md
brew install md-serverMIT License - feel free to use this project for your own needs!