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.
  • --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.8.tar.gz (13.7 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.8-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mdpdf-0.0.8.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for mdpdf-0.0.8.tar.gz
Algorithm Hash digest
SHA256 5f73c5b01afd89fef3e5f470748c5d176db8f60e9d1a304bc93e1c20ad5747b7
MD5 7d7a64acb6fef29f962d088102b44f2c
BLAKE2b-256 2d6b18d9e03a80c9087b4a095d367888031f741ba451630cdb532956b665bb53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mdpdf-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for mdpdf-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a23d1b94f7f30dea273b8a2bb5eaee909efb3ddd9ac9fae0e5c878649e41eb38
MD5 c80eedda13463bea76e7c2ae375c5122
BLAKE2b-256 d8e5186cfad57462f89982fa53927b2401c613a2f057c98d3f98e375dd46e55f

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