mdparser-html
A lightweight, extensible Markdown → HTML converter with a clean Python API and CLI.
Built for simplicity, hackability, and future extension.
Documentation
-> https://mdparser.tarunnayaka.me
🤔 Why mdparser-html?
- Lightweight alternative to full Markdown engines
- Easy to extend and hack
- Designed for learning, tooling, and static generators
✨ Features
- Markdown → HTML conversion
- Full HTML document or body-only output
- Syntax highlighting via CDN (Prism / Highlight.js)
- Headings, lists, code blocks, images
- Fenced blocks (
:::) - CLI + Python API
- Zero runtime dependencies
- Tailwind support
📦 Installation
pip install mdparser-html
🚀 Usage CLI
md2html input.md -o output.html
</> Python API
Basic usage
from mdparser import parse_markdown
html = parse_markdown("# Hello World")
print(html)
🎨 Styling Support
mdparser-html supports attaching custom CSS or Tailwind utility classes
directly from Markdown using fenced blocks and headings.
Tailwind is included automatically when include_cdn=True is set.
Example:
::: bg-blue-100 p-4 rounded-lg
# Welcome
This section is styled using Tailwind classes.
:::
rendered as
<div class="bg-blue-100 p-4 rounded-lg">
<h1>Welcome</h1>
<p>This section is styled using Tailwind classes.</p>
</div>
Styled headings
## [text-green-500 font-bold] Success Heading
Renders as:
<h2 class="text-green-500 font-bold">Success Heading</h2>
⚙️ Configuration Options # Advanced usage ```python html = parse_markdown(
markdown_text, full_html=True, title="My Document", include_cdn=True # Include syntax highlighting CDN links ) print(html)
Body-only output
body = parse_markdown(markdown_text, full_html=False)
print(body)
Fenced blocks
:::
# Welcome
This is a hero section
:::
rendered as
<div class="hero">
<h1>Welcome</h1>
<p>This is a hero section</p>
</div>
🗂️ Supported Markdown
- Headings (
#→########) - Bold / Italic
- Inline code
- Fenced code blocks
- Ordered & unordered lists
- Images
- Fenced div blocks
- Links
- Blockquotes
- Horizontal rules
- Paragraphs
- Tables (basic)
🛠 Design Notes
- Single public API:
parse_markdown - Internal helpers are intentionally hidden
- Designed for future renderers (HTML today, more later)
🧾 CHANGELOG.md
Create a new file called CHANGELOG.md
🗺 Roadmap
- AST-based parser
- Performance optimizations
- Additional output formats (e.g. Pug)
- Plugin hooks
🤝 Contributing
Pull requests are welcome. Please open an issue before major changes.
License
MIT License © 2025 Tarun Nayaka R (Rtarun3606k)
Metadata
Release files for mdparser-html 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mdparser_html-2.0.2.tar.gz | 13.7 kB | Without provenance | Details for mdparser_html-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mdparser_html-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for mdparser_html-2.0.2-py3-none-any.whl |
Total release size: 25.7 kB
Release files / mdparser_html-2.0.2.tar.gz
| Download URL | mdparser_html-2.0.2.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b87cfaf16b7daca544673509e1154fd3b7001fd15f81215dd7350e43af5c4107
|
|
BLAKE2b-256 checksum How to use checksums |
6474157347ed347753f3ac3f5e00c0107b8331478f7c33b24ddcaff441f35421
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / mdparser_html-2.0.2-py3-none-any.whl
| Download URL | mdparser_html-2.0.2-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1717320817da09d6a6de1179aec2f230efa35a030868645f6ba7d82d6fcfc567
|
|
BLAKE2b-256 checksum How to use checksums |
14c03e648526c0b9f635721142d969e08e1581e1d25817ff705e5431c5a0ffa6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Security for mdparser-html 2.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.