Page 1 of 1

Create Parts in Ditamaps

Posted: Fri May 05, 2023 7:42 pm
by amyers3
I know there is a part element for bookmaps, I'm wondering if there is a documented procedure for creating parts in a ditamap so that TOC links for parts work and PDF Bookmarks for parts work.
PART I: Something
Chapter 1: Something
Chapter 2: Something Else
PART II: Something Else
Chapter 3: Continue

Thanks,
Adam

Re: Create Parts in Ditamaps

Posted: Sun May 07, 2023 10:46 pm
by chrispitude
Hi Adam,

If it helps, the <part> element can point to a topic file just like chapters, etc. So you could do something like

Code: Select all

<part href="part1.dita">
  <chapter ...>
    <topicref .../>
  </chapter>
</part>
Are you creating PDF outputs, HTML outputs, or both?

- Chris

Re: Create Parts in Ditamaps

Posted: Mon May 08, 2023 9:57 pm
by amyers3
Hi Chris,
I have pdf and html output. The part element isn't a valid DITA map element.
Thanks,
Adam

Re: Create Parts in Ditamaps

Posted: Tue May 09, 2023 12:02 am
by chrispitude
HI Adam,

For HTML-based outputs, if you navigate to an "empty" map element that has no topic content associated with it (like a <part> with a navtitle but no @href to a topic), then you are taken to the next element in the map that does have content. So adding placeholder topics to these elements might do what you want.

I think PDF outputs do not have this requirement, and PDF bookmarks can point to title-only placeholders.

- Chris

Re: Create Parts in Ditamaps

Posted: Tue May 09, 2023 10:24 am
by julien_lacour
Hi Adam,

Besides what Chris said, <part> element is only valid in a <bookmap> not in a classic ditamap.
You can check the DITA specs for more details.

You can use Tools > XML Refactoring dedicated "Convert DITA Map to Bookmap" operation to transform your ditamap and start using <part>.

Regards,
Julien

Re: Create Parts in Ditamaps

Posted: Tue May 09, 2023 4:01 pm
by amyers3
Thanks. I have already checked the specs. I was hoping someone had a workaround. I don't want to convert all of my ditamaps to bookmaps.

Re: Create Parts in Ditamaps

Posted: Tue May 09, 2023 4:07 pm
by chrispitude
Hi Adam,

One workaround would be to define your own @outputclass values on <topicref> or <topichead> map elements, then write your own DITA-OT plugin to make this work somehow -- either by turning your map into a bookmap during "mapref" reading in preprocessing, or by implementing overrides in all the transtype-specific extension points you might publish to.

But at that point, it seems easier (and more reliable!) to simply use a bookmap.

Re: Create Parts in Ditamaps

Posted: Tue May 09, 2023 8:20 pm
by amyers3
Sounds like it. Thanks Chris.