Skip to main content

A command line tool to convert files to fancy PDFs

Project description

Build Status PyPI version

A command line tool to convert files to fancy PDFs.

This tool generates nice-looking reports, letters, presentations etc. from Markdown. Other formats also work, but aren't really supported. The only Output format is PDF.

You can use custom themes with customizable fonts, logos and names.

Installation

You can install this tool by running pip install make_pdf.

Requirements

This project requires python (at leas 3.6) and pip.

Furthermore, texlive and a bunch of packages for it need to be installed. Here I opted for just installing texlive-most on Arch Linux.

If you're running this on Linux you may need to install pandoc.

Furthermore, you need the following fonts: Roboto, Inconsolata and Yanone Kaffeesatz installed.

From source

You can also build it from source yourself.

  1. Clone this repository: git clone https://git.eorlbruder.de/EorlBruder/mdp2df.git
  2. Install with pip: pip install .

Usage

By default, this tool only requires an input-file. Thus, the following command works as a minimal example:

make_pdf plain test.md

This command will create a test-plain.pdf-file. You can also provide multiple input-files make_pdf plain test.md test1.md.

All input-file-types supported by pandoc are supported, but some features will only work with markdown.

You'll get a bunch more information with make_pdf --help or using the --help flag after any command.

You'll also find much more information in the docs.

Commands

Make_pdf has four commands for generating files.

The first one you already know, it's plain. This generates a simple document, like for example a report or a handout.

Then there's newsletter. This is very similar to plain - only that every section gets displayed in a box, as well as the title.

Next we have letter. This command needs some extra metadata and generates a formal letter.

Last but not least there's presentation which generates a beamer-presentation.

Every command will generate a file with the name of the mode as its suffix, so for example make_pdf letter test.md generates test-letter.pdf.

Options

You can provide every command with options. You can find out which ones are available in particular by using make_pdf <command> --help.

Metadata

Files generally get generated with their metadata. You have several options to provide them.

First, if you're using Markdown you can provide the title, author and date at the beginning of the file:

% Title
% Author
% Date

You can also provide them in a yaml-block:

---
title: Title
author: Author
date: Date
---

You can also provide them via a separate yml-file, which you just provide together with the input-files:

make_pdf plain metadata.yml file.md

Last, there's also the option to provide them as options:

make_pdf plain file.md --title Title --author Author --date Date

If you don't provide a date, it will be automatically set to today's date. If you don't want this behaviour, you can disable it with the --no-automatic-date-option.

Contribute

To see how to contribute please have a look at the CONTRIBUTING.md-file.

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

make_pdf-0.1.0.post4.tar.gz (57.8 kB view hashes)

Uploaded Source

Built Distribution

make_pdf-0.1.0.post4-py3-none-any.whl (58.7 kB view hashes)

Uploaded Python 3

Supported by

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