Bug 1044848 - RFE: Expose functionality to set TOC depth in PDF output
Summary: RFE: Expose functionality to set TOC depth in PDF output
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: future
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 4.1
Assignee: Jeff Fearn 🐞
QA Contact: Ruediger Landmann
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-19 05:46 UTC by David O'Brien
Modified: 2014-05-05 06:03 UTC (History)
3 users (show)

Fixed In Version: 4.1.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-05 06:03:24 UTC


Attachments (Terms of Use)

Description David O'Brien 2013-12-19 05:46:20 UTC
Description of problem:

Would like to be able to specify TOC depth in PDF files. Current behaviour seems to be to display all chapter and section heading levels used in the document.

Version-Release number of selected component (if applicable):
4.0

How reproducible:
Always

Steps to Reproduce:
1. Build any book with extended section depth (3 or 4)
2. Compare PDF and HTML outputs
3. HTML honors toc_section_depth parameter in publican.cfg but PDF does not

Actual results:

If book contains chapter and section headings down to level 4, 5, or beyond, they all appear in the TOC.


Expected results:

Would like ability to set TOC_DEPTH=<num> to limit depth to (e.g.) 1.2.3. This improves the usability of the TOC itself and if desired can be set to match that used by html output.

Additional info:

Comments from IRC exchange:

rudi: what problem are you trying to solve?
davido:  just wondering if we can match up TOC depth between the two outputs
davido: 3.1.4.7.1. Using Templates
davido: gets a bit scary

rudi: I don't think "The ToC depths is different in html and pdf" is something we'd try to solve, given that pdf is not html
rudi: But if the ToC depth is unreasonable in PDF per se, then yeah, that's a bug
rudi: FWIW, it looks like it's configurable, but maybe not on a book-by-book basis: http://code.google.com/p/wkhtmltopdf/issues/detail?id=772

rudi: I'm pretty sure it's configurable in DocBook, which would mean just exposing that control
rudi: Yeah, it is: http://docbook.sourceforge.net/release/xsl/1.77.0/doc/html/toc.section.depth.html

Comment 1 Jeff Fearn 🐞 2014-03-04 23:50:26 UTC
This should be available via the wkhtmltopdf_opts cfg parameter.

e.g. add this to publican.cfg

wkhtmltopdf_opts: "--outline-depth 3"

Can you try this please?

Comment 2 David O'Brien 2014-03-05 04:15:08 UTC
Tried a few variations of wkhtmltopdf_opts: "--outline-depth 3" but it only impacts the outline depth in the nav bar on the side pane (in Evince). It doesn't impact the TOC depth at all.

Comment 3 Jeff Fearn 🐞 2014-03-17 06:31:14 UTC
Pass chunk_section_depth to wkhtmltopdf.

To ssh://git.fedorahosted.org/git/publican.git
   376ae38..58bf708  devel -> devel

Comment 4 Jeff Fearn 🐞 2014-05-05 06:03:24 UTC
A fix for this shipped in Publican 4.1.0.


Note You need to log in before you can comment on or make changes to this bug.