Skip to main content

convertor is a simple and easy to use library for converting markdown files to various formats.

Project description

📝 md2all

A minimal Python package to convert Markdown files to clean, responsive HTML with Tailwind CSS, MathJax, and beautiful typography.

Ideal for note-taking, documentation, and publishing markdown content as styled web pages.

PyPI Python Version License


🚀 Features

  • 🧪 Convert .md files into HTML
  • 🎨 Built-in support for Tailwind CSS
  • 🧮 Renders LaTeX/Math using MathJax
  • ✨ Applies prose styling for readability
  • 🗂 Outputs to your desired directory

📦 Installation

pip install md2all

Upcoming Features

  • 📜 Support for custom CSS
  • Support for PDF generation
  • Support for custom themes
  • Support for custom fonts

How to Use it

Sure! Here's a concise and developer-friendly documentation for using the convert_markdown function as part of your Python library (assuming it's installed from PyPI):


📄 convert_markdown

Convert a Markdown (.md) file into a styled HTML file with TailwindCSS and MathJax support.


🔧 Function Signature

convert_markdown(md_path: str, output_dir: str = "", output_format: str = "pdf") -> str

✨ Features

  • Converts .md files to clean, styled HTML
  • Supports LaTeX math using $$...$$ (rendered via MathJax)
  • Automatically applies Tailwind CSS and custom styling
  • Resolves relative paths and saves output to the desired directory

📥 Parameters

Name Type Description
md_path str Path to the input Markdown file. Can be relative or absolute.
output_dir str (Optional) Directory to save the converted file. Defaults to input file's directory.
output_format str (Optional) Set to "html" to output HTML. Default is "pdf", but PDF is not implemented yet.

📤 Returns

  • Full path to the converted file.

🧪 Example Usage

from md2all import convert_markdown

# Convert a Markdown file to HTML
output_file = convert_markdown("notes/my_math_notes.md", output_dir="output", output_format="html")

print("File saved to:", output_file)

📁 Output Structure

  • create a .html file to your specified output_dir, if not provided, it will be saved in the same directory as the input file.
  • Includes all CSS and MathJax setup in the HTML head section. all css and js library are inside /home/.lib/

Author

  • Deepak Raj

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

md2all-0.0.2.tar.gz (569.5 kB view details)

Uploaded Source

Built Distribution

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

md2all-0.0.2-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file md2all-0.0.2.tar.gz.

File metadata

  • Download URL: md2all-0.0.2.tar.gz
  • Upload date:
  • Size: 569.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for md2all-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c638048df785875c7353ea0aa9301c81c80a77e885a96b98f590c3def7fc3e77
MD5 811e8a74842dc9b917dc9ad7cc7fba23
BLAKE2b-256 8591b9b0452b481c173125eb349b3baecbe42b6bb5f99abc1e291bf867576861

See more details on using hashes here.

File details

Details for the file md2all-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: md2all-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for md2all-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 def21f16b97e2926f8c13ce0a7ba8eaa704a8e83a2a58f73cf3412f47dbba634
MD5 0317a8ee488f29e7d995b6e8795dcd07
BLAKE2b-256 f3a8d059a49ec4c6893e682c66e956af63142d4a5c2fe8bb2d0892598bef7971

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