Maven PDF Plugin
  1. Maven PDF Plugin
  2. MPDF-10

Support menu sub-items in table of contents

    Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Currently, every source document starts a new chapter.

        Issue Links

          Activity

          Lukas Theussl made changes -
          Field Original Value New Value
          Link This issue is depended upon by MPDF-9 [ MPDF-9 ]
          Lukas Theussl made changes -
          Link This issue is duplicated by MPDF-55 [ MPDF-55 ]
          Hide
          Data Nucleus added a comment -

          Since this worked with Maven1 (pre-Doxia), I find it a bit odd on upgrading to Maven3 it is no longer a feature, so PDF's generated via Maven3 look stupid with the TOC listing things as 1.0, 1.1, 2.0, 2.1, 2.2 and the content listing things as 1.1, 2.1, 3.1, 4.1, 5.1 etc. Any idea on the complexity of this, and how long it would take to be implemented (given the time to do it)?

          Alternatively, if I just want the TOC to just have top-level entries in them, is there any way of guaranteeing the ordering of sub items within these top level items?

          Show
          Data Nucleus added a comment - Since this worked with Maven1 (pre-Doxia), I find it a bit odd on upgrading to Maven3 it is no longer a feature, so PDF's generated via Maven3 look stupid with the TOC listing things as 1.0, 1.1, 2.0, 2.1, 2.2 and the content listing things as 1.1, 2.1, 3.1, 4.1, 5.1 etc. Any idea on the complexity of this, and how long it would take to be implemented (given the time to do it)? Alternatively, if I just want the TOC to just have top-level entries in them, is there any way of guaranteeing the ordering of sub items within these top level items?
          Hide
          Samuel Sj÷berg added a comment -

          I've forked doxia-doc-renderer on github in an attempt to fix this for FOP.

          https://github.com/sasjo/maven-doxia-sitetools

          I've changed the FoPdfRenderer to do a 2-pass rendering of the document. The first round is using the IndexingSink (from the TocMacro) and allows me to build a DocumentTOC where each configured chapter (i.e., document) has been extended to include the titles in the document. Things seems to work OK for the test cases and my real-word documents so far. Perhaps this could be a starting point for a full-on solution if not already sufficient as-is.

          Show
          Samuel Sj÷berg added a comment - I've forked doxia-doc-renderer on github in an attempt to fix this for FOP. https://github.com/sasjo/maven-doxia-sitetools I've changed the FoPdfRenderer to do a 2-pass rendering of the document. The first round is using the IndexingSink (from the TocMacro) and allows me to build a DocumentTOC where each configured chapter (i.e., document) has been extended to include the titles in the document. Things seems to work OK for the test cases and my real-word documents so far. Perhaps this could be a starting point for a full-on solution if not already sufficient as-is.
          Hide
          Data Nucleus added a comment -

          Hi Samuel, thx for your efforts to get this working again. How can I give your version a try? I've built your code (v 1.4-SNAPSHOT). Presumably I need a new version of the PDF plugin that uses this version? or are there other interdependencies that need updating too?

          FWIW My docs project is at
          https://datanucleus.svn.sourceforge.net/svnroot/datanucleus/documentation/accessplatform.datanucleus.org/branches/maven3/

          It has multiple levels of <item> in the pdf.xml, resulting in a 1000+ page PDF. A simple "mvn clean pdf:pdf" is all that is needed to run it. The TOC always has correct section numbers, yet the actual sections always end up wrong/inconsistent with the TOC.

          Show
          Data Nucleus added a comment - Hi Samuel, thx for your efforts to get this working again. How can I give your version a try? I've built your code (v 1.4-SNAPSHOT). Presumably I need a new version of the PDF plugin that uses this version? or are there other interdependencies that need updating too? FWIW My docs project is at https://datanucleus.svn.sourceforge.net/svnroot/datanucleus/documentation/accessplatform.datanucleus.org/branches/maven3/ It has multiple levels of <item> in the pdf.xml, resulting in a 1000+ page PDF. A simple "mvn clean pdf:pdf" is all that is needed to run it. The TOC always has correct section numbers, yet the actual sections always end up wrong/inconsistent with the TOC.
          Hide
          Samuel Sj÷berg added a comment -

          It seems I've probably misinterpreted this defect. The solution I've built just takes an existing DocumentModel and expands each document that's included to build the TOC from actual contents. However it's still sitting in chapters based on the original configured TOC and I've done nothing explicit to handle nested, linked documents.

          If you still want to try out my solution you can build my version of the maven-pdf-plugin. It has the dependency to my customized maven-doxia-sitetools
          https://github.com/sasjo/maven-plugins/tree/trunk/maven-pdf-plugin

          To try it out, first do mvn install for the maven-doxia-sitetools/doxia-doc-renderer, then mvn install on my maven-pdf-plugin. Then change groupId and version in your POM to point to the values in my projects.

          Show
          Samuel Sj÷berg added a comment - It seems I've probably misinterpreted this defect. The solution I've built just takes an existing DocumentModel and expands each document that's included to build the TOC from actual contents. However it's still sitting in chapters based on the original configured TOC and I've done nothing explicit to handle nested, linked documents. If you still want to try out my solution you can build my version of the maven-pdf-plugin. It has the dependency to my customized maven-doxia-sitetools https://github.com/sasjo/maven-plugins/tree/trunk/maven-pdf-plugin To try it out, first do mvn install for the maven-doxia-sitetools/doxia-doc-renderer, then mvn install on my maven-pdf-plugin. Then change groupId and version in your POM to point to the values in my projects.
          Hide
          Data Nucleus added a comment -

          I've updated the way of reproducing this flaw :-

          svn co https://datanucleus.svn.sourceforge.net/svnroot/datanucleus/documentation/accessplatform-maven-skin/trunk dn-maven-skin
          cd dn-maven-skin
          mvn clean install
          cd ..
          svn co https://datanucleus.svn.sourceforge.net/svnroot/datanucleus/documentation/accessplatform/trunk dn-project
          cd dn-project
          mvn clean pdf:pdf

          This creates a PDF like
          http://www.datanucleus.org/products/accessplatform_3_2/datanucleus-accessplatform-docs.pdf
          which has section numbers correct in TOC, but not in the doc.

          Alternatively if anyone can provide tips on where the problem lies in Doxia/PDF code then please add them here so someone could look at it if time.

          Show
          Data Nucleus added a comment - I've updated the way of reproducing this flaw :- svn co https://datanucleus.svn.sourceforge.net/svnroot/datanucleus/documentation/accessplatform-maven-skin/trunk dn-maven-skin cd dn-maven-skin mvn clean install cd .. svn co https://datanucleus.svn.sourceforge.net/svnroot/datanucleus/documentation/accessplatform/trunk dn-project cd dn-project mvn clean pdf:pdf This creates a PDF like http://www.datanucleus.org/products/accessplatform_3_2/datanucleus-accessplatform-docs.pdf which has section numbers correct in TOC, but not in the doc. Alternatively if anyone can provide tips on where the problem lies in Doxia/PDF code then please add them here so someone could look at it if time.

            People

            • Assignee:
              Unassigned
              Reporter:
              Lukas Theussl
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: