{"repo":"jmaupetit/md2pdf","free":true,"listed":false,"github":"https://github.com/jmaupetit/md2pdf","clone":"git clone https://github.com/jmaupetit/md2pdf.git","description":"Markdown to PDF with styles","language":"Python","stars":439,"topics":["markdown","pdf-generation","css","pdf"],"license":"MIT","category":"media-processing","readme_excerpt":"Convert Markdown files to PDF with styles. Installation The easiest way to test md2pdf is to use uv : Nota bene: ensure, Weasyprint is fully functional before using md2pdf. You will find installation instructions in the project documentation: https://doc.courtbouillon.org/weasyprint/stable/first steps.html#installation Usage As a CLI For example, try to generate the project documentation with: A README.pdf should have been generated. Optionally, you may load an external style sheet: And activate markdown extensions from PyMdown: Code blocks should be properly rendered when this extension is active. As a library If you have added md2pdf as a dependency for your python project, you can use md2pdf in your code, like: Function arguments: pdf : output PDF file path raw : input markdown raw string content (can contain Jinja instructions) md : input markdown file path (can contain Jinja instructions) css : input styles path (CSS) base url : absolute base path for markdown linked content (as images) extras : markdown extra extensions that should be activated context : variables to inject to rendered Jinja template With Docker Considering docker is installed, pull the latest Debian-based image: And try to run a smoke test with this image: There is also a smaller Alpine-based image tagged alpine . For a full list of available tags, check the project's DockerHub repository. Use Jinja templates as input Your input markdown file or raw content can include Jinja template tags, and context ","default_branch":null,"files":null,"tree":[],"storefront":"/r/jmaupetit","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jmaupetit/md2pdf/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}