Implemented improved glossary markup which allows multiple terms per definition
+ In contrast to regular definition lists, *multiple* terms per entry are
+ allowed, and inline markup is allowed in terms. You can link to all of the
+ terms. For example::
+
+ .. glossary::
+
+ term 1
+ term 2
+ Definition of both terms.
+
+ (When the glossary is sorted, the first term determines the sort order.)
+
.. versionadded:: 0.6
You can now give the glossary directive a ":sorted:" flag that will
automatically sort the entries alphabetically.+ .. versionchanged:: 1.1
+ Now supports multiple terms and inline markup in terms.
--- a/tests/root/markup.txt +++ b/tests/root/markup.txt .. glossary:: + :sorted: boson Particle with integer spin. - fermion + *fermion* Particle with half-integer spin. + tauon + myon + electron + Examples for fermions. + + über + Gewisse + + änhlich + Dinge +
This development is very interesting. Use of the visitor pattern.
- https://bitbucket.org/birkenfeld/sphinx/changeset/32c4f57a02c9
- CHANGES (3 lines added, 0 lines removed)
- doc/markup/para.rst (18 lines added, 3 lines removed)
- sphinx/addnodes.py (3 lines added, 0 lines removed)
- sphinx/domains/std.py (86 lines added, 22 lines removed)
- sphinx/roles.py (0 lines added, 1 lines removed)
- sphinx/writers/html.py (4 lines added, 0 lines removed)
- sphinx/writers/latex.py (5 lines added, 1 lines removed)
- sphinx/writers/manpage.py (4 lines added, 0 lines removed)
- sphinx/writers/texinfo.py (3 lines added, 0 lines removed)
- sphinx/writers/text.py (4 lines added, 0 lines removed)
- tests/root/markup.txt (13 lines added, 1 lines removed)
. rst:directive:: .. glossary:: |
||
155 |
155 |
|
156 |
This directive must contain a reST definition list with terms and |
|
157 |
definitions. The definitions will then be referencable with the :rst:role:`term` |
|
158 |
|
|
156 |
This directive must contain a reST definition-list-like markup with terms and |
|
157 |
definitions. The definitions will then be referencable with the |
|
158 |
:rst:role:`term` role. Example:: |
|
159 |
159 |
|
160 |
160 |
.. glossary:: |
161 |
161 |
|
| … | … | @@ -169,10 +169,25 @@ Glossary |
169 |
169 |
The directory which, including its subdirectories, contains all |
170 |
170 |
source files for one Sphinx project. |
171 |
171 |
|
172 |
In contrast to regular definition lists, *multiple* terms per entry are |
|
173 |
allowed, and inline markup is allowed in terms. You can link to all of the |
|
174 |
terms. For example:: |
|
175 |
||
176 |
.. glossary:: |
|
177 |
||
178 |
term 1 |
|
179 |
term 2 |
|
180 |
Definition of both terms. |
|
181 |
||
182 |
(When the glossary is sorted, the first term determines the sort order.) |
|
183 |
||
172 |
184 |
.. versionadded:: 0.6 |
173 |
185 |
You can now give the glossary directive a ``:sorted:`` flag that will |
174 |
186 |
automatically sort the entries alphabetically. |
175 |
187 |
|
188 |
.. versionchanged:: 1.1 |
|
189 |
Now supports multiple terms and inline markup in terms. |

