# Markdown Server A Rust-based web server that serves Markdown files from a `./content` directory as HTML. The URL path corresponds to the file path within the content directory. ## Features - **Automatic Markdown to HTML conversion** - Uses `pulldown-cmark` for fast Markdown parsing - **Flexible path resolution** - Any URL path maps to `./content/{path}.md` - **Configurable working directory** - Specify where the `./content` folder is located - **Customizable host and port** - Run on any interface and port - **Automatic content discovery** - Shows available content on startup ## Installation ```bash cargo build --release ``` ## Usage ```bash # Default usage (current directory, port 8080) ./target/release/mhmmcontent # Custom working directory ./target/release/mhmmcontent --workdir /path/to/your/content # Custom port ./target/release/mhmmcontent --port 9090 # Custom host and port ./target/release/mhmmcontent --host 0.0.0.0 --port 8888 # All options ./target/release/mhmmcontent --workdir /path/to/content --host 0.0.0.0 --port 9090 ``` ## How It Works 1. **Directory Structure**: Place your Markdown files in a `./content` directory 2. **URL Mapping**: The server maps URL paths directly to file paths: - `http://localhost:8080/foo/bar` → `./content/foo/bar.md` - `http://localhost:8080/zap/zap` → `./content/zap/zap.md` - `http://localhost:8080/` → `./content/index.md` 3. **Markdown Processing**: Files are converted to HTML with proper styling ## Example Given this directory structure: ``` content/ ├── index.md ├── foo/ │ └── bar.md └── zap/ └── zap.md ``` The server will serve: - `http://localhost:8080/` → `content/index.md` - `http://localhost:8080/foo/bar` → `content/foo/bar.md` - `http://localhost:8080/zap/zap` → `content/zap/zap.md` ## Command Line Options ``` Options: -w, --workdir Working directory containing the ./content folder [default: .] -p, --port Port to bind the server to [default: 8080] --host Host to bind the server to [default: 127.0.0.1] -t, --template