A fast, minimal Markdown → HTML converter written in pure Rust, using:
clapfor elegant CLI argument parsingpulldown-cmarkfor Markdown parsingmaudfor HTML templating
- Converts any
.mdfile into a clean.htmlfile - Supports Markdown tables, strikethrough, and basic GFM syntax
- Automatically generates an output
.htmlfile if not specified - Fast, zero-dependency binary — no runtime setup needed
- Simple CLI with
-iand-oflags
Make sure you have Rust (>=1.84, Edition 2024) installed.
git clone https://github.com/Chaganti-Reddy/md2html.git
cd md2html
cargo build --releaseThe compiled binary will be in:
./target/release/md2htmlConvert a Markdown file:
cargo run -- -i test.mdthis will generate a test.html file in the current directory. Convert a Markdown file and specify an output file:
cargo run -- -i test.md -o test.htmlRun the CLI with -h or --help to see all available options.
Input: test.md
# Hello World
This is a *Markdown* **test**.
- Supports lists
- Tables
- Strikethrough ~~like this~~Output: test.html
<html>
<head>
<title>My MD2HTML</title>
</head>
<body>
<h1>Hello World</h1>
<p>This is a <em>Markdown</em> <strong>test</strong>.</p>
<ul>
<li>Supports lists</li>
<li>Tables</li>
<li>Strikethrough <del>like this</del></li>
</ul>
</body>
</html>Main Components:
Argsstruct: Handles CLI arguments and options viaclaprender_html_pagefunction: Renders the HTML page usingmaudmainfunction: Parses Markdown, converts to HTML, and writes the output to a file
- Support more Markdown features
- Add
--serveflag for live preview - Add support for code blocks and syntax highlighting
- Add support custom CSS themes
Pull requests and ideas are welcome!
If you'd like to contribute:
- Fork the repository
- Create a feature branch
- Commit your changes
- Submit a pull request
This project is licensed under the MIT License.