How jmaupetit/md2pdf works
Project type and purpose
• This is a Python-based command-line tool and library (“md2pdf”) whose sole responsibility is to take Markdown input (file or raw text), render it via a Markdown-to-HTML engine and WeasyPrint, and produce a styled PDF. It also ships as a Docker image and is published on PyPI.
File structure
• md2pdf/
• __main__.py – entry point for Python invocation
• cli.py – Click (or argparse)-based CLI interface
• core.py – central conversion logic (md to HTML, HTML to PDF)
• conf.py – default settings (CSS path, extras list, base_url, etc.)
• exceptions.py – domain-specific error types
• tests/ – unit tests for CLI and core logic
• .github/workflows/ – CI pipelines for Docker image build and Python package tests
• Dockerfile, Makefile, pyproject.toml – build, package and release configuration
README for additional insights
• Shows three user-visible interfaces: pip install md2pdf for library/API use, md2pdf for CLI use, and docker run jmaupetit/md2pdf for container use.
• Emphasizes external dependency WeasyPrint’s installation.
• Documents primary function signatures, flags, and default behavior.