Automate Glossary

I have created a glossary for my project. Each entry is a partial .adoc in a partial family folder in a glossary module. That way, I am including the entries in other pages across the documentation. e.g. include::glossary:partialentry.adoc[]. Now I would like to create a glossary page glossary.adocwith all entries from the partial family. I am dreaming of a directive such as include::partial*.adoc assuming here aren't any other files located there. Is that available? Couldn't find anything when searching for "wirldcards" related to "include" in antora or asciidoc.

djencks 18:09 @ukubauka_gitlab There is no way to do that built in to Antora, but it is not that difficult with an Asciidoctor extension that queries the Antora content catalog. My https://gitlab.com/djencks/asciidoctor-antora-indexer shows how to do such queries and almost does what you need directly: what's missing is a way to get the resourceId of the partial so you can construct the include:: statement. I might add that now 😃. You also need to consider how the inclusions will get ordered properly: this is not a feature of the Antora catalog 😃 There are a couple other approaches to a glossary that you might consider: having one glossary page with tags around every entry, and for the in-text includes using the tag to select the lines to include. This doesn't need any Antora extensions to work. having the partials only include the data as attributes for the term and definition. In this case you could use my index extension (probably the dlist support) both to construct the in-text uses (with a query returning one match) and the glossary (with a query returning everything). if you start thinking that keeping the glossary data in json might work better, you could put the entire glossary in one json file (under examples) and query it using https://gitlab.com/djencks/asciidoctor-jsonpath, rather similarly to the previous suggestion. Finally, although I can't really recommend this as it requires customizing Antora with pipeline extensions, https://gitlab.com/djencks/asciidoctor-glossary provides an inline macro for defining glossary entries and a block macro for collecting them into a glossary. This works fine with a single page with the glossary at the end but in Antora you need a pipeline extension to order the pages so that the page with the glossary is generated last, after all the entries have been collected. Until Antora gets pipeline extensions built in, I think this is "interesting to think about but to be avoided for actual use".

djencks 18:45 My 2nd suggestion won't work as partials don't get document attributes as they aren't standalone documents. To get it to work, you'd need to put the glossary entries in a separate component as regular pages, and then hide that component in the component explorer..... not a good idea.

Edited by Ulf Riehm