Convert markdown files to beautifully styled PDFs with customizable CSS themes.
brew tap buckleypaul/homebrew-tap
brew install mdglowpip install mdglowpipx install mdglow# Basic conversion (uses default theme)
mdglow input.md
# Use a built-in theme
mdglow input.md --theme github
# Use a custom CSS file
mdglow input.md --theme /path/to/custom.css
# Specify output path
mdglow input.md --output report.pdf
# Include table of contents
mdglow input.md --toc
# Include page numbers
mdglow input.md --page-numbers
# Combine options
mdglow input.md --theme academic --toc --page-numbers --output paper.pdf
# List available themes
mdglow --list-themes- default - Clean, readable with good typography
- github - GitHub-flavored markdown style
- minimal - Simple black/white, minimal styling
- academic - Serif fonts, suitable for papers and reports
Create your own CSS theme and pass it to mdglow:
mdglow input.md --theme /path/to/my-theme.cssYour CSS can include @page rules for controlling page size and margins:
@page {
size: A4;
margin: 2.5cm;
}- Syntax highlighting for code blocks (Pygments)
- Tables support
- Table of contents generation
- Page numbers
- Custom CSS themes
- Smart typography (quotes, dashes)
# Clone the repository
git clone https://github.com/buckleypaul/mdglow.git
cd mdglow
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytestMIT