You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use the glossary directive multiple times in a documentation without problems when you never define the same word twice.
This makes it possible to have a glossary with subtitles for topics eg.
I wonder if anyone ever had the need to put more than one glossary into the documentation. Maybe domain specific glossaries? One for math terms and one for chemical terms.
If this is a realistic usecase it would be nice to label the glossaries so that I can specify where a term belongs to. Maybe some kind of indicator as we use with the domains.
Example:
#!rst
.. glossary:: math
term
(definition)
This is a :math:term:`term`for my math specific glossary
Reacted by Serge Matveenko, dbzm, Anna Leonova, hardikpnsp, Attila Viniczai, Lucky Resistor, Jan Lukány, Arsha Mamoozadeh, Nicolas Peugnet, Erlend E. Aasland and 1 more
To add to this issue, I'm currently writing a page with a list of categories and their definitions. I thought that the glossary directive would be a good fit since, as per its dictionary definition, I indeed have “an alphabetical list of words relating to a specific subject, text, or dialect, with explanations”. On top of that, the glossary directive makes it easy to link individually to each category. But then what if I end up writing an other glossary to globally define some terms?
I'm writing extensive documentation using sphinx. Some commonly used modules are included as shared resources into these documentations. Having glossaries in this included documentation would help a lot. At the moment, this is not possible, because terms used in these included parts can always cause conflicts.
I see two simple solutions:
Merging glossary terms from multiple sources into one central glossary with priorities.
Allow separate glossaries with an additional identifier.
Reasons for Multiple Glossaries
Extensive documentation covering different fields with conflicting terminologies (design, math, coding). The same term has a different meaning in different parts of the documentation.
Modular documentation with inserted documentation parts. E.g. three applications use the same library to provide some functionality. The documentation for this functionality is included in the documentation of the main application.
Merging with Priorities
.. glossary::
:priority: secondary
term
Secondary definition
foo
Foo definition
.. glossaty::
:priority: main
term
Primary definition
bar
Bar definition
Result
term
Primary definition
bar
Bar definition
foo
Foo definition
Secondary definitions are never rendered at the original place where they are defined but in the main glossary.
Separate Glossaries with Identifiers
Text with own :term:`terms<myid:term>`
.. glossary:: myid
term
Term definition
Reacted by abbycross, Charles Bouchard-Légaré, Oriol Abril-Pla and Arsha Mamoozadeh
one glossary for common (project wide) definitions
one glossary for process, method and tools stuff
one glossary for test terminology
one glossary for each subsystem
A term must only appear once in one of those glossaries. What I am looking for is a "glossary of glossaries" page, i.e. a merged glossary term index. Is that possible with Sphinx as of today?
An additional case where you might have multiple glossaries with overloaded/conflicting terms: intersphinx.
I would like to have intersphinx for linking to e.g. API docs for multiple dependencies and would also like to use :term: to refer to a glossary definition in one of them that happens to also be present in the other. A workaround appears to be defining the term in my own glossary which then links directly to the desired external term anchor URL, but it's unclear if that precedence is explicit or an implementation detail.
Activity
christophercrouzet commentedon Jan 9, 2017
To add to this issue, I'm currently writing a page with a list of categories and their definitions. I thought that the glossary directive would be a good fit since, as per its dictionary definition, I indeed have “an alphabetical list of words relating to a specific subject, text, or dialect, with explanations”. On top of that, the glossary directive makes it easy to link individually to each category. But then what if I end up writing an other glossary to globally define some terms?
LuckyResistor commentedon Feb 5, 2021
I'm writing extensive documentation using sphinx. Some commonly used modules are included as shared resources into these documentations. Having glossaries in this included documentation would help a lot. At the moment, this is not possible, because terms used in these included parts can always cause conflicts.
I see two simple solutions:
Reasons for Multiple Glossaries
Merging with Priorities
Result
term
Primary definition
bar
Bar definition
foo
Foo definition
Secondary definitions are never rendered at the original place where they are defined but in the main glossary.
Separate Glossaries with Identifiers
arwedus commentedon Nov 28, 2021
In a large project, we have:
A term must only appear once in one of those glossaries. What I am looking for is a "glossary of glossaries" page, i.e. a merged glossary term index. Is that possible with Sphinx as of today?
ixjlyons commentedon Jul 6, 2026
An additional case where you might have multiple glossaries with overloaded/conflicting terms: intersphinx.
I would like to have intersphinx for linking to e.g. API docs for multiple dependencies and would also like to use
:term:to refer to a glossary definition in one of them that happens to also be present in the other. A workaround appears to be defining the term in my own glossary which then links directly to the desired external term anchor URL, but it's unclear if that precedence is explicit or an implementation detail.