Adding the map title in the header of every html page with html5 plugin

24 views
Skip to first unread message

bing

unread,
Aug 31, 2022, 12:25:41 AM8/31/22
to DITA-OT Users
I am intending to add the map title in the header of all the html pages generated by html5 plugin. I have known that the map and the topics are processed seperatedly in html5 plugin. So how can I get the map title when processing topics?

Radu Coravu

unread,
Aug 31, 2022, 1:25:30 AM8/31/22
to bing, DITA-OT Users
Hi,

If you look in this build file "plugins/org.dita.html5/build_dita2html5.xml" at the ANT target named "html5.topics.common" this parameter is passed as a parameter to the XSLT stylesheet:

    <param name="input.map.url" expression="${html5.map.url}" if:set="html5.map.url"/>

so you probably just need to declare it in the XSLT and you will be able to use its value like the "plugins/org.dita.html5/xsl/nav.xsl" does:

  <xsl:param name="input.map.url" as="xs:string?"/>
 
  <xsl:variable name="input.map" as="document-node()?">
    <xsl:apply-templates select="document($input.map.url)" mode="normalize-map"/>
  </xsl:variable>

As a bext practice most DITA OT publishing customizations are made with plugins. An HTML customization plugin can pass extra parameters from the ANT build files to the XSLT customization stylesheet: https://www.oxygenxml.com/forum/post67068.html

Regards,
Radu

On Wed, Aug 31, 2022 at 7:25 AM bing <eric...@163.com> wrote:
I am intending to add the map title in the header of all the html pages generated by html5 plugin. I have known that the map and the topics are processed seperatedly in html5 plugin. So how can I get the map title when processing topics?

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/1b908156-a825-4296-83e6-c9c39e2b617dn%40googlegroups.com.

Toshihiko Makita

unread,
Aug 31, 2022, 5:02:07 AM8/31/22
to DITA-OT Users
Hi Bing,
I have started making sample program based above suggestion. But I have not succeeded the HTML build. In fact, I have minimum experience to customize DITA-OT standard HTML5 because it is complicated and not sorted out.
In the past I developed our own HTML5 plugin named AH-HTML5. I realized that it is far easier to use this plugin.
However, I will continue to make samples using DITA-OT HTML5 plugin.
Regards,

2022年8月31日水曜日 14:25:30 UTC+9 raduc...@gmail.com:

Toshihiko Makita

unread,
Aug 31, 2022, 6:51:29 AM8/31/22
to DITA-OT Users
Hi bing,
I've uploaded sample plugin named com.acme.html and the test result.

plug-in

Test result

As usual, copy com.acme.html folder to [DITA-OT 3.7.2]/plugins and issue "bin/dita --install" from shell at [DITA-OT 3.7.2].


2022-08-31_New.png

Regards,

Toshihiko Makita

2022年8月31日水曜日 18:02:07 UTC+9 Toshihiko Makita:
Reply all
Reply to author
Forward
0 new messages