Re: How can I treat a <mapref> as a level of TOC hierarchy?


Chris Papademetrious
 

Hi Eliot,

As always, thanks for jumping in!

We use SyncroSoft's PDF Chemistry for PDF publishing. And it behaves correctly - it doesn't create navigation hierarchy from submap titles. My previous comment was that topichead levels added inside a <bookmap> would alter the book PDF's TOC, so modifying the <bookmap> is not an option.

However, your mention of <navtitle> within <topicmeta> pointed me in the right direction! I get the desired result by variable-izing the book titles, then creating a top-level map as follows:

<map>
    <title>Online Help</title>

    <topichead>

      <topicmeta>
        <navtitle><ph keyref="book1.BookTitle"/></navtitle>
      </topicmeta>
      <mapref href="book1.ditamap" format="ditamap" keyscope="book1"/>
    </topichead>

    <topichead>

      <topicmeta>
        <navtitle><ph keyref="book2.BookTitle"/></navtitle>
      </topicmeta>
      <mapref href="book2.ditamap" format="ditamap" keyscope="book2"/>
    </topichead>

</map>


When I publish this map (either with the DITA-OT's html5 transformation or with Oxygen's WebHelp Responsive transformation), each book has its own hierarchy item, named after the book title. Success!

With this success under my belt, I started poking around in the preprocess2 pipeline to see if I could automate the creation of these <topichead>/<navtitle>/<mapref> constructs with a user-specified attribute as a convenience:

      <mapref href="book1.ditamap" format="ditamap" keyscope="book1" outputclass="topichead"/>
      <mapref href="book2.ditamap" format="ditamap" keyscope="book2" outputclass="topichead"/>

It is achievable, but there are some complexities with ensuring that book titles with profiling conditions and book-local variables are handled properly. I might keep at it just to learn more about the processing pipeline. But for production, I think it's better to stick with pure DITA without adding yet another plugin dependency.

 - Chris

Join main@dita-users.groups.io to automatically receive all group messages.