Giter Club home page Giter Club logo

mkdocs-pdf-flatten's Introduction

mkdocs-pdf-flatten

This is meant to be used in conjunction with shauser's mkdocs-pdf-export-plugin, which already does a fantastic job of adding HTML > PDF documents for each generated mkdocs page (and custom download links on each page!).

I've used some of the best parts of jgrassler's mkdocs-pandoc, which actually works really, really well. However it didn't pull the full document together with bookmarks tree laid out properly for me.

This script will:

  • Parse through the mkdocs.yml file (nav section only)

  • Correctly identify root level documents and headers

  • Nth level documents, headers, their parents and their child documents

  • Stitch together all PDF files generated from those .md (.html) files, into one long coherent document

  • Add bookmarks at all the right places

  • Model the outline (bookmark) tree in the same manner as specified in the mkdocs.yml file.

Requirements

mkdocs-pdf-export-plugin, installed, running and tested.

PyPDF2 (python -m pip install PyPDF2)

Usage

  1. Place into your parent folder with mkdocs.yml.

  2. Build your mkdocs site with python -m mkdocs build.

  3. Run python mkdocs_pdf_flatten.py -o output.pdf

Options

Not much there, I've ripped most of the stuff out of the original mkdocs-pandoc in favour of just stitching the PDF's together.

-f --> Specify config file

-e --> Specify encoding (doesn't actually do much)

-o --> Output file. Should default to output.pdf.

mkdocs-pdf-flatten's People

Contributors

eloops avatar

Stargazers

Theodore M avatar  avatar Benoit Brayer avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

mkdocs-pdf-flatten's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.