Skip to content
Alex-R-APublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

MarkdownToPDF

A macOS installer that creates a native app for converting Markdown files to PDF. Double-click any .md file to convert and view it in Preview.

Requirements

  • macOS (Apple Silicon or Intel)
  • Xcode Command Line Tools when Homebrew, pandoc, or weasyprint must be installed

Installation

bash install-markdowntopdf.sh

The installer will:

  1. Install Homebrew (if not present)
  2. Install pandoc, weasyprint, and duti via Homebrew
  3. Create ~/Applications/MarkdownToPDF.app
  4. Set MarkdownToPDF as the default handler for .md, .markdown, and .mdown files

If automatic file association fails, set manually:

  1. Right-click any .md file in Finder
  2. Select "Get Info"
  3. Under "Open with:", choose "MarkdownToPDF"
  4. Click "Change All..."

Usage

Double-click any .md, .markdown, or .mdown file. The PDF is created in the same directory and opens in Preview.

Uninstall

Remove the app manually. Remove customization and Homebrew packages only if they are no longer needed elsewhere:

rm -rf "$HOME/Applications/MarkdownToPDF.app"
rm -f "$HOME/Applications/.MarkdownToPDF.install.lock"
rm -rf "$HOME/Library/Application Support/MarkdownToPDF"  # optional
brew uninstall weasyprint pandoc duti  # optional

Design Decisions

The following behaviors are intentional:

  • No uninstall command: Removal is straightforward enough to not warrant a dedicated uninstaller.
  • Silent stderr on success: Successful conversions suppress warnings to avoid noisy output. Errors are shown in a dialog on failure.
  • Hardcoded font sizes (8pt body, 7pt code): Dynamic sizing produced inconsistent results across documents.
  • PDF overwrite without warning: The workflow prioritizes speed. The source .md file is never modified.

Customization

Copy the default stylesheet to Application Support, then edit that copy:

mkdir -p "$HOME/Library/Application Support/MarkdownToPDF"
cp -n "$HOME/Applications/MarkdownToPDF.app/Contents/Resources/md2pdf.css" \
  "$HOME/Library/Application Support/MarkdownToPDF/md2pdf.css"

The external stylesheet overrides the bundled default and survives app reinstalls without invalidating the app signature. CSS url(...) resources are blocked; use declarations that do not load files or network resources.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages