How to show a glossary in HTML-based output?

Post here questions and problems related to editing and publishing DITA content.
Frank Ralf
Posts: 505
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

How to show a glossary in HTML-based output?

Post by Frank Ralf »

Hi,
I want to output a glossary as a separate chapter in my WebHelp documentation. However, the glossary does not show up in the output using any of the HTML-based transformation scenarios (HTML5, WebHelp Responsive, PDF - based on HTML5 & CSS). I have tried to use the attributes print="yes" and deliveryTarget="html" but to no avail. Am I missing something?

Best regards,
Frank

EDIT
I did some more testing and the glossary entries are generated in the HTML output but the glossary does not show up in the TOC.
Frank Ralf
parson AG
www.parson-europe.com
julien_lacour
Posts: 778
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to show a glossary in HTML-based output?

Post by julien_lacour »

Hi Frank,

You could use a topichead as visible in flowers.ditamap from our samples:

Code: Select all

<topichead navtitle="Glossary" id="glossary">
Regards,
Julien
Frank Ralf
Posts: 505
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How to show a glossary in HTML-based output?

Post by Frank Ralf »

Hi Julien,

Thanks for the pointer, will try that.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 505
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How to show a glossary in HTML-based output?

Post by Frank Ralf »

Hi Julien,

I did some testing and found some strange behavior:
  • Glossary items only show up in the HTML output when they are referenced by <topicref> instead of <glossref>.
  • The displayed text is taken from <glossterm>, the @navtitle attribute is ignored.
  • @print and @deliveryTarget attributes are ignored as well.
Works

Code: Select all

 <topicref navtitle="Genus" href="concepts/glossaryGenus_t.dita" keys="genus" print="yes"/>
Same as:

Code: Select all

 <topicref href="concepts/glossaryGenus_t.dita" keys="genus" />
Does not work

Code: Select all

<glossref navtitle="Genus" href="concepts/glossaryGenus_g.dita" keys="genus" print="yes"/>
Same as:

Code: Select all

<glossref href="concepts/glossaryGenus_g.dita" keys="genus" />
I find this strange because <glossref> is a specialization of <topicref>. Is this the intended behavior?

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 505
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How to show a glossary in HTML-based output?

Post by Frank Ralf »

I think I found the reason for this behavior:

<glossref> has set the @toc attribute to "no" by default, whereas the @toc attribute is undefined for <topicref>. So this does the trick:

Code: Select all

<glossref href="concepts/glossaryGenus_g.dita" keys="genus" toc="yes"/>
So your initial tip to define a <topichead> was only part of the solution ;-)

Kind regards,
Frank

EDIT
According to the DITA specs the @toc attribute cascades so you should be able to set it on the <map> or <mapref> element. However, this does not seem to work.
Frank Ralf
parson AG
www.parson-europe.com
julien_lacour
Posts: 778
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to show a glossary in HTML-based output?

Post by julien_lacour »

Hi Frank,

If I refer to the specification, the default value should be set before the cascade (if you check the list order). So I assume this is the expected behavior, I don't think the cascade should override the default value (this could lead to unexpected results).
Do you have the possibility to send us a sample so we can analyze it and see if there is a problem?

Regards,
Julien
Frank Ralf
Posts: 505
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How to show a glossary in HTML-based output?

Post by Frank Ralf »

Hi Julien,

Thanks for the quick reply and the pointer to the specs. I had not found that page yet. Come to think of it, you are right, that the cascade should not override the default value. Thanks for your kind offer to look into this but I think I have understood the working of glossary elements now ;-)

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Post Reply