Repository navigation
feat(export): add a table of contents page to the PDF - #204
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PDF can now start with a table of contents listing the h1 to h3 headings with the page where each one falls.
How it works, without new dependencies:
body page + 1 + index pagesand it is the real page by construction.paginar_indiceflows the rows onto as many pages as needed, the first one discounting the heading height, and the numbering shifts with them.export-toc.Also in here: the image menu labels from #194 (
Small,Medium,Large,Align centre) now go through a literalgettext()call, so regenerating the.potno longer loses them.Verified:
make checkgreen (221 unit tests) and the new ignored end to end test exports real PDFs and checks every entry against the page the heading is really on: 5 pages with a one page index, 11 pages with a two page index (70 headings) and the Manuscript template with its title block. I checked those numbers again withpdftotext -layoutoutside the test.Out of scope, as the issue said: PDF bookmarks and clickable internal links, which need post-processing the written file.
The READMEs no longer claim that the PDF has no table of contents.
Closes #195