Skip to content

buckleypaul/mdglow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdglow

Convert markdown files to beautifully styled PDFs with customizable CSS themes.

Installation

Via Homebrew (macOS)

brew tap buckleypaul/homebrew-tap
brew install mdglow

Via pip

pip install mdglow

Via pipx (isolated environment)

pipx install mdglow

Usage

# 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

Built-in 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

Custom Themes

Create your own CSS theme and pass it to mdglow:

mdglow input.md --theme /path/to/my-theme.css

Your CSS can include @page rules for controlling page size and margins:

@page {
    size: A4;
    margin: 2.5cm;
}

Features

  • Syntax highlighting for code blocks (Pygments)
  • Tables support
  • Table of contents generation
  • Page numbers
  • Custom CSS themes
  • Smart typography (quotes, dashes)

Development

# Clone the repository
git clone https://github.com/buckleypaul/mdglow.git
cd mdglow

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

License

MIT

About

Convert markdown files to beautifully styled PDFs with customizable CSS themes

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors