Skip to main content

MdToPdf backend for Foliant documentation generator.

Project description

MdToPdf backend for Foliant

This backend generates a single PDF document from your Foliant project. It uses md-to-pdf library under the hood.

md-to-pdf supports styling with CSS, automatic syntax highlighting by highlight.js, and PDF generation with Puppeteer.

MdToPdf backend for Foliant operates the pdf target.

Installation

First install md-to-pdf on your machine:

$ node install -g md-to-pdf

Then install the backend:

$ pip install foliantcontrib.mdtopdf

Usage

$ foliant make pdf --with mdtopdf
Parsing config... Done
Applying preprocessor flatten... Done
Applying preprocessor mdtopdf... Done
Applying preprocessor _unescape... Done
Making pdf with md-to-pdf... Done
────────────────────
Result: MyProject.pdf

Config

You don't have to put anything in the config to use MdToPdf backend. If it's installed, Foliant will detect it.

You can however customize the backend with options in backend_config.mdtopdf section:

backend_config:
  mdtopdf:
    mdtopdf_path: md-to-pdf
    options:
      stylesheet: https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.min.css
      body_class: markdown-body
      css: |-
        .page-break { page-break-after: always; }
        .markdown-body { font-size: 11px; }
        .markdown-body pre > code { white-space: pre-wrap; }

mdtopdf_path : is the path to md-to-pdf executable. Default: md-to-pdf

options : is a mapping of options which then will be converted into JSON and fed to the md-to-pdf command. For all possible options consult the md-to-pdf documentation.

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

foliantcontrib.mdtopdf-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

foliantcontrib.mdtopdf-1.0.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file foliantcontrib.mdtopdf-1.0.0.tar.gz.

File metadata

  • Download URL: foliantcontrib.mdtopdf-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.1

File hashes

Hashes for foliantcontrib.mdtopdf-1.0.0.tar.gz
Algorithm Hash digest
SHA256 df08c8dbf55cad24d4f5d6c17713884720f8e9b8f35bcc6faee9ecb0c3083355
MD5 78a70e6d97b7b7fcdec16cde69861d5e
BLAKE2b-256 bc5baa5941f700f8e00d8f2ec9a95a5f5590f092f69f116236bfe9af092e093e

See more details on using hashes here.

File details

Details for the file foliantcontrib.mdtopdf-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: foliantcontrib.mdtopdf-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.1

File hashes

Hashes for foliantcontrib.mdtopdf-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a51f3fe7e9f93fc8131f5c575cfa843ea5dfbfccfdb6d3249c6f52b4547d379
MD5 71340beb576356027500df3c1f5ba0cf
BLAKE2b-256 c166f765f5ff4dfcc19efe134377cb59dc71c2d79967fe0a37ee02f80d703b65

See more details on using hashes here.

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