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.3.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.3-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: md2all-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 c6e1e49f495697872a0130ed194d701c17c99aa9c4770812ff225d43e5be3f81
MD5 74e56e22d6362e36c7c087c98393dfc7
BLAKE2b-256 1bd174505f20c2fe42b5b39d962011ec3f4509423cef23bd48a29fa120e3ef35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: md2all-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1baa94ca5fccc70f3d87dc426f9d418e36248035f7d36097c4664992f96fec73
MD5 103fe9b318af7a6faf8990106087fcfe
BLAKE2b-256 38cb939815758b54449be67a7eb6d082166644f7e9d56e8053507f73c5903b0f

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