"…mais ce serait peut-être l'une des plus grandes opportunités manquées de notre époque si le logiciel libre ne libérait rien d'autre que du code…"

Sphinx developpment : Implemented improved glossary markup which allows multiple terms per definition.

Posted by patrick sur janvier 7, 2011

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.

. 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
   role.  Example::
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.

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s

 
%d blogueurs aiment cette page :