PDF transform of single topic from map

Post here questions and problems related to editing and publishing DITA content.
kgajda
Posts: 32
Joined: Wed Aug 16, 2017 8:07 pm

PDF transform of single topic from map

Post by kgajda »

I am working on writing a PDF plugin to take a single release notes topic from a large ditamap (not bookmap) and output it as a PDF.
I had 2 thoughts of either transforming on the map and having it only output the one topic, or if choosing the specific release notes topic and transforming on it. I started testing against just the one topic because I thought that might be an easier project, but I have questions.
1) Do you think the publishing the single topic vs the logic of parsing it from the map is the way to go or do you recommendations on going about that?
2) Going the route of the single topic, I am running into problems of keyrefs not being populated. Is there a way to include them or point to the container file for them?
3) Also doing the single topic, it’s looking for a Book Title to put in the header, which it just populates with Book Title as it’s undefined.. I want to change the header and footer completely to be specific for standalone release notes and not like part of a manual. In the static-content.xsl I see templates for a bunch of different header and footer info. Is there a way to figure out which ones would adjust that and how many places I will need to change it?
Sorry for all of the questions - any specifics or just the direction to go in would help.
Thanks!
:) Kim
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: PDF transform of single topic from map

Post by Radu »

Hi Kim,

Please see some answers below:
1) Do you think the publishing the single topic vs the logic of parsing it from the map is the way to go or do you recommendations on going about that?
Problem is that the single topic might not be standalone, it may have various conrefs, keyrefs or hrefs to other topics as you also discovered.
2) Going the route of the single topic, I am running into problems of keyrefs not being populated. Is there a way to include them or point to the container file for them?
The publishing engine does not have a processing mode in which you could process one topic but state that you want the keys to be resolved based on a certain DITA Map.
There is an issue registered for this:

https://github.com/dita-ot/dita-ot/issues/1697

As a possible workaround in Oxygen 20.1 we added in the main DITA menu an action called "Replace all references with content" which can be called on a topic to expand all its key references or content references. Then you can save the topic, publish and then undo it back.
3) Also doing the single topic, it’s looking for a Book Title to put in the header, which it just populates with Book Title as it’s undefined.. I want to change the header and footer completely to be specific for standalone release notes and not like part of a manual. In the static-content.xsl I see templates for a bunch of different header and footer info. Is there a way to figure out which ones would adjust that and how many places I will need to change it?
Maybe you can have two PDF customization plugins with two different transtypes, one for single topic publishing and one for map publishing.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
kgajda
Posts: 32
Joined: Wed Aug 16, 2017 8:07 pm

Re: PDF transform of single topic from map

Post by kgajda »

Hi Radu! I met you at LavaCon Portland last year - it's great to "see" you again.

Thanks for the quick response. That's a nice workaround for resolving the keys.
Maybe you can have two PDF customization plugins with two different transtypes, one for single topic publishing and one for map publishing.
The two different PDF plugins is exactly the route I am trying to go. We already have the one for map publishing, extended from PDF2. I created the second, for single topic publishing, and copied over its files to retain the styling and start from there. I'm trying to find which templates and files I need to modify to adjust the headers and footers for this single topic one.

Thanks again for all of your help!
Kim
kgajda
Posts: 32
Joined: Wed Aug 16, 2017 8:07 pm

Re: PDF transform of single topic from map

Post by kgajda »

I should mention that I did modify the build and plugin files and integrate to create a new transtype, releasenotespdf. I just need to customize the output now.
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: PDF transform of single topic from map

Post by Radu »

Hi,

In the XSLT stylesheet "DITA-OT\plugins\org.dita.pdf2\xsl\fo\static-content.xsl" there are a lot of templates called something like "insertBodyOddFooter". You probably need to find out which one to override in your customization.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply