Generate outline for pdf generated by `mdbook-pdf`.
Project description
Introduction
Generate outline for pdf files generated using mdbook-pdf
Motivation
mdbook-pdf
is good, but...
In example, I create a simple book, and I use mdbook-pdf
as renderer to export pdf
with outline.
cd example/a_book
docker run --rm -v $PWD:/book hollowman6/mdbook-pdf
You can see the generated pdf
in ./example/a_book/book/pdf-outline/output.pdf
.
Also, you can see the generated HTML
in ./example/a_book/book/html
Different outline
The sidebar of HTML
is like: html_outline, which is what I want.
The outline of pdf is like: pdf_outline, a little bit different with html. Every heading in markdown file is shown in the outline, without any order.
The reason
The pdf outline is generated by mdbook_pdf_outline. It base on the print.html
rendered by HTML engine, and the outline is generated by HTML Headings
, not SUMMARY.md
. Therefore, if there are any headings in your markdown file, they will appear in the outline.
Quick Start
Install
pip3 install mdbook_pdf_summary
Run
1. Generate pdf
pushd example/a_book
docker run --rm -v $PWD:/book hollowman6/mdbook-pdf
popd
2. Generate outline based on SUMMARY.md
mdbook-pdf-summary --html_path ./example/a_book/book/html/print.html \
--pdf_path ./example/a_book/book/pdf/output.pdf \
--summary_path ./example/a_book/src/SUMMARY.md \
--output_path ./output_with_outline.pdf
The above command will generate output_with_outline.pdf
in your $WORKDIR
, the outline is like: summary_outline, same as SUMMARY.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mdbook_pdf_summary-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a5b4fc1673ea242afd52eec1aedd2edabea6137e8af7674521eb985125b3487 |
|
MD5 | 01c33cd80bcbfd5b806d44fc72f5edeb |
|
BLAKE2b-256 | d6e32c336740dda92647185a1cd733389ece553b02f565052c713b9fe10314bb |