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
  • Not necessarily beautiful: Left-aligned, PDF-base14 fonts. Reasonably pretty, but if you want more control, see alternatives below.
  • Images inserted with optional captions and width specifier.
  • File attachments inserted with PDF links.
  • 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.7.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.7-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mdpdf-0.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 4415f70154d28b5f03f90863097b68089dc3149b042261974dc175bc5551eaf7
MD5 5c080f97feb16f3eb15ab815ed1fec51
BLAKE2b-256 200de20019728f6e2cf6c4642503e418f3130cdbf8cfb31754ee7a157233f6ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mdpdf-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 14.6 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a2b6557e2ec3753c37c46dd56d3d8f5ea722c0a49e49e291909346ba72b8bf2d
MD5 dfcdfd7bab3023113e39533834a52470
BLAKE2b-256 e147e7c95cc68a66470eb86c218431ad5a11447d575365c80a9c7eeb654d1e9e

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