A fast and lightweight server that serves markdown files as HTML pages with beautiful typography.
- π GitHub Flavored Markdown support
- π¨ Beautiful typography with Source Serif font
- π Serves static files alongside markdown
- π± Responsive design
- π Automatic index.md rendering
- π οΈ Customizable with YAML configuration
- β‘ Built with Rust for maximum performance
# Clone the repository
git clone https://github.com/yourusername/markdown-server
cd markdown-server
# Build the project
cargo build --release
# Run the server
cargo run --release -- /path/to/your/markdown/files
# With configuration file (required)
cargo run -- serve --config /path/to/config.yaml
# Backward compatibility mode
cargo run -- --config /path/to/config.yaml
# Export markdown to HTML (config required)
cargo run -- export --output-dir /path/to/html --config /path/to/config.yaml
docs/
βββ index.md # Served at /
βββ guide.md # Served at /guide
βββ tutorials/
βββ index.md # Served at /tutorials/
βββ basics.md # Served at /tutorials/basics
- Headers (h1-h6)
- Lists (ordered and unordered)
- Code blocks with syntax highlighting
- Tables
- Task lists
- Blockquotes
- Links and images
- Strikethrough
- And more!
PORT
: Server port (default: 3000)
When creating a custom template, the following variables are available:
{{content}}
- The markdown content converted to HTML{{title}}
- Page title from frontmatter'stitle
field (default: "Markdown Viewer"){{header_title}}
- Header title from frontmatter'stitle
field (default: "Wiki"){{description}}
- Description from frontmatter'sdescription
field (default: "Markdown document"){{frontmatter_block}}
- HTML block with formatted frontmatter information (author, date, description, tags){{navigation_links}}
- Navigation links from the configuration file (or default links if not provided)
You can customize the appearance and content of your markdown site using a YAML configuration file. Here's an example:
# Source directory for markdown files (required)
source_dir: "/path/to/your/markdown/files"
# Template directory for HTML templates (optional, default: "./templates")
template_dir: "/path/to/templates"
# Custom CSS to be injected into the HTML page
custom_css: |
body {
max-width: 85ch; /* Wider content area */
}
h1, h2, h3 {
color: #1e5285; /* Custom heading colors */
}
# Custom HTML content for the page header
header: |
<div style="text-align: center; padding: 20px;">
<img src="/logo.png" alt="Logo" height="60">
</div>
# Custom HTML content for the page footer
footer: |
<div style="text-align: center; margin-top: 30px;">
<p>Β© 2025 Your Organization</p>
</div>
# Navigation links to be displayed in the header
navigation:
- text: Home
url: /
- text: Documentation
url: /docs
- text: GitHub
url: https://github.com/intellicode/mdserve
# Run tests
cargo test
# Run with hot reloading
cargo watch -x run -- /path/to/docs
# Check formatting
cargo fmt -- --check
# Run linter
cargo clippy
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
All official release binaries are signed using Sigstore, which provides keyless signing and verification. This allows you to verify that the binaries were built and signed as part of our official GitHub Actions release process.
To verify a binary:
-
Install the Sigstore CLI:
brew install cosign
-
Download the binary and its signature files: Visit the Releases page to download the binary for your platform along with sigstore bundle.
-
Verify the signature:
cosign verify-blob mdserve-darwin-arm64 \ --bundle mdserve-darwin-arm64.sigstore.json \ --certificate-identity "https://github.com/Intellicode/mdserve/.github/workflows/rust.yml@refs/tags/v0.5.3" \ --certificate-oidc-issuer "https://token.actions.githubusercontent.com"
This verification ensures that the binary was signed by the official GitHub Actions workflow during the release process.