Skip to main content

mdparser-html is a lightweight and extensible Markdown → HTML converter with a clean Python API and CLI.

Project description

mdparser-html

A lightweight, extensible Markdown → HTML converter with a clean Python API and CLI.

Built for simplicity, hackability, and future extension.


🤔 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

📦 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)

⚙️ Configuration Options

Advanced usage

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

🛠 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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdparser_html-0.2.2.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdparser_html-0.2.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file mdparser_html-0.2.2.tar.gz.

File metadata

  • Download URL: mdparser_html-0.2.2.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for mdparser_html-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ff2c4fe6ece299a791d61efb015fcf8b7cc075d5d35f207b0c27f06d8c5cd1b7
MD5 4778841f8ca232871f50e79c343a2cc4
BLAKE2b-256 f5fc13ae3a9297ce0fb7c8dbef8521549ece885b66488f168a181bfa5f26b2e6

See more details on using hashes here.

File details

Details for the file mdparser_html-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: mdparser_html-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for mdparser_html-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5238e0265ff6119b829cf867b26a8bb4f799005ee218075bd6834059d215dd6c
MD5 76d9250613aff0e035594eea268ccfea
BLAKE2b-256 b872e3754dd24697394e3b1a7ccb62e734cccc4f5937939c7293923a7fcc2240

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page