| Crates.io | mkweb |
| lib.rs | mkweb |
| version | 0.1.0 |
| created_at | 2026-01-06 02:23:26.689018+00 |
| updated_at | 2026-01-06 02:23:26.689018+00 |
| description | A markdown to html converter and server |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2024991 |
| size | 65,081 |
A simple command-line tool written in Rust that converts Markdown files into HTML files. It uses pulldown-cmark for parsing and supports building an entire directory of Markdown files into a corresponding set of HTML outputs.
.md to .html using pulldown-cmark.clap..html files through localhost with serve commannd.Clone the repository and build the project:
git clone https://github.com/Niall-Sharma/mkweb.git
cd <project-directory>
cargo build --release
The compiled binary will appear in target/release/.
Convert an entire Markdown directory into HTML:
./mkweb --input ./notes
./mkweb --input ./notes --output ./public
./mkweb --input ./notes --output ./public --clean
| Flag / Option | Description |
|---|---|
-i, --input |
Path to the directory containing Markdown files |
-o, --output |
Output directory for generated HTML (default: public) |
--clean |
Remove the output directory before generating files |
build |
Run the build pipeline |
serve |
Serve the generated files using localhost |
Example full command:
mkweb --input ./content --output ./site build
src/
main.rs # CLI + command routing
builder.rs # Directory scanning and file operations
parser.rs # Markdown → HTML conversion logic
Collect Markdown files:
The program walks the input directory and finds all files ending in .md.
Parse Markdown:
Each file’s contents are fed into pulldown-cmark::Parser.
Generate HTML:
The converted HTML is written into a corresponding .html file in the output directory.
Output result:
If --clean is passed, the output directory is recreated fresh before writing.
MIT License. See LICENSE for details.