A simple Python script to convert Markdown files to PDF using the markdown_pdf library.
This project provides a script (md_to_pdf.py) that takes a Markdown file as input and generates a PDF file.
It is recommended to use a virtual environment to manage the project's dependencies.
Create a Virtual Environment:
First, ensure you have a compatible Python version installed via pyenv. If not, you can install one (e.g., 3.11.0):
pyenv install 3.11.0Then, create a virtual environment for this project:
pyenv virtualenv 3.11.0 md-to-pdf-envActivate the Virtual Environment:
To activate the environment, run:
pyenv activate md-to-pdf-envYou should see the environment name (e.g., (md-to-pdf-env)) in your shell prompt.
To deactivate the environment when you are finished, simply run:
pyenv deactivateWith your virtual environment activated, install the required packages:
pip install -r requirements.txtTo convert a Markdown file to PDF, use the -i flag for the input file and the -o flag for the output file.
Example:
python md_to_pdf.py -i summary.md -o output.pdfThis will convert summary.md to output.pdf.