Skip to main content

Python command line application to convert Markdown to PDF.

Project description

mdpdf

License: MIT Code style: black

Python command line application to convert Markdown to PDF.

Project Features

  • Bare-bones: Only supports basic CommonMark
  • "One-size-fits-all" style: Left-aligned, PDF-base14 fonts. Reasonably pretty, but if you want more control, see alternatives below.
  • Headings are transformed to PDF bookmarks.
  • File links are transformed into attachments with PDF links.
  • Images links are transformed into embedded images with optional captions and width specifier.
  • Minimal requirements

Alternatives

There are several projects that can be considered if you need something with more features. Of note:

Installation

$ pip install mdpdf

Usage

$ mdpdf [OPTIONS] [INPUTS]...

Options:

  • -o, --output FILE Destination for file output. [required]
  • -h, --header <template> Sets the header template.
  • -f, --footer <template> Footer template.
  • -t, --title TEXT PDF title.
  • -s, --subject TEXT PDF subject.
  • -a, --author TEXT PDF author.
  • -k, --keywords TEXT PDF keywords.
  • -p, --paper [letter|A4] Paper size (default letter).
  • --version Show the version and exit.
  • --help Show this message and exit.

Templates:

The <template> is a quoted, comma- delimited string, containing the left, centre, and right, fields for the header/footer. Format is "[left],[middle],[right]".

Possible values to put here are:

  • Empty string
  • Arbitrary text
  • Special variables:
    • {page} current page number
    • {header} current top-level body text heading
    • {date} current date

Example:

$ mdpdf -o article.pdf article.md

$ mdpdf -o article.pdf --footer "{date},{heading},{page}" article.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdpdf-0.0.15.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdpdf-0.0.15-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file mdpdf-0.0.15.tar.gz.

File metadata

  • Download URL: mdpdf-0.0.15.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for mdpdf-0.0.15.tar.gz
Algorithm Hash digest
SHA256 267b54e463db043b4b8f1ce68b28a395817e9d9162f58b9699e133b8f29912b8
MD5 333dda59d73de807a113e190cadb9de7
BLAKE2b-256 3b6f43ddaf146e7ef1af7df03a9570b77dbc00bb72343317ac5f39d0b2b631ff

See more details on using hashes here.

File details

Details for the file mdpdf-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: mdpdf-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for mdpdf-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 4f79761395e7e383f8ee280ec2a37b14238b019592297543f78c7fa68227df38
MD5 b8ad5157bd17448933b1b56791aff0c4
BLAKE2b-256 2cce1b2a4dc70da15a24198d778c55edaa6c9aa4ca1c0a1eaffa1c12a3f9dafa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page