# HG changeset patch
# User Florent Hivert <Florent.Hivert@univ-rouen.fr>
# Date 1307006484 -7200
# Node ID 4daef384dc34498d46b251d08c3db58ab4b272dd
# Parent b069845d0c5f7f334062fd4c5c060fb839613982
#11251: Add todo extension to Sphinx
diff --git a/doc/common/conf.py b/doc/common/conf.py
a
|
b
|
sys.path.append(os.path.abspath(os.path. |
14 | 14 | # Add any Sphinx extension module names here, as strings. They can be extensions |
15 | 15 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
16 | 16 | extensions = ['sage_autodoc', 'sphinx.ext.graphviz', |
17 | | 'sphinx.ext.inheritance_diagram'] |
| 17 | 'sphinx.ext.inheritance_diagram', 'sphinx.ext.todo'] |
18 | 18 | #, 'sphinx.ext.intersphinx', 'sphinx.ext.extlinks'] |
19 | 19 | |
20 | 20 | if 'SAGE_DOC_JSMATH' in os.environ: |
… |
… |
inheritance_graph_attrs = { 'rankdir' : |
89 | 89 | inheritance_node_attrs = { 'height' : 0.5, 'fontsize' : 12, 'shape' : 'oval' } |
90 | 90 | inheritance_edge_attrs = {} |
91 | 91 | |
| 92 | # Extension configuration |
| 93 | # ----------------------- |
| 94 | |
| 95 | # include the todos |
| 96 | todo_include_todos = True |
| 97 | |
| 98 | |
92 | 99 | # Sage trac ticket shortcuts. For example, :ticket:`7549` . |
93 | 100 | #extlinks = {'ticket': ('http://trac.sagemath.org/sage_trac/ticket/', 'Ticket ')} |
94 | 101 | |
diff --git a/doc/common/themes/sage/static/sage.css_t b/doc/common/themes/sage/static/sage.css_t
a
|
b
|
div.note { |
205 | 205 | border: 1px solid #ccc; |
206 | 206 | } |
207 | 207 | |
| 208 | div.admonition-todo { |
| 209 | background-color: #eee; |
| 210 | border: 1px solid #ccc; |
| 211 | } |
| 212 | |
208 | 213 | div.seealso { |
209 | 214 | background-color: #ffc; |
210 | 215 | border: 1px solid #ff6; |
diff --git a/doc/en/developer/conventions.rst b/doc/en/developer/conventions.rst
a
|
b
|
a guide. |
397 | 397 | build, it is very likely that you would be requested to |
398 | 398 | change your patch. |
399 | 399 | |
| 400 | - A TODO block for rooms for improvements. The TODO block might |
| 401 | contains disabled doctests to demonstrate the desired feature. A TODO block |
| 402 | should start with ``.. TODO::``. It can also be the lower-case form |
| 403 | ``.. todo::``. However, you are encouraged to use the upper-case form |
| 404 | ``.. TODO::``. Here's an example of a TODO block:: |
| 405 | |
| 406 | .. TODO:: |
| 407 | |
| 408 | Improve further function ``have_fresh_beers`` using algorithm |
| 409 | ``buy_a_better_fridge``:: |
| 410 | |
| 411 | sage: have_fresh_beers('Bière de l'Yvette') # todo: not implemented |
| 412 | Enjoy ! |
| 413 | |
400 | 414 | - A REFERENCES block to list books or papers (optional). This block serves |
401 | 415 | a similar purpose to a list of references in a research paper, or a |
402 | 416 | bibliography in a monograph. If your method, function or class uses an |
diff --git a/doc/en/introspect/conf.py b/doc/en/introspect/conf.py
a
|
b
|
import sys, os |
6 | 6 | sys.path.append(os.environ['SAGE_DOC']) |
7 | 7 | from common.conf import * |
8 | 8 | |
9 | | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.jsmath'] |
| 9 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.jsmath', 'sphinx.ext.todo'] |
10 | 10 | |
11 | 11 | templates_path = ['templates'] |
12 | 12 | html_static_path = ['static'] |
… |
… |
html_use_modindex = False |
15 | 15 | html_use_index = False |
16 | 16 | html_split_index = False |
17 | 17 | html_copy_source = False |
| 18 | |
| 19 | todo_include_todos = True |
diff --git a/doc/en/reference/index.rst b/doc/en/reference/index.rst
a
|
b
|
Enjoy Sage! |
93 | 93 | modmisc |
94 | 94 | tensor |
95 | 95 | |
| 96 | todolist |
| 97 | |
96 | 98 | history_and_license |
97 | 99 | |
98 | 100 | Indices and tables |
diff --git a/doc/en/reference/todolist.rst b/doc/en/reference/todolist.rst
new file mode 100644
-
|
+
|
|
| 1 | .. _ch:todolist: |
| 2 | |
| 3 | SAGE's To Do list |
| 4 | ================= |
| 5 | |
| 6 | There is still some work to do :-) : |
| 7 | |
| 8 | .. warning:: |
| 9 | |
| 10 | This list is currently very incomplete as most doctests do not use the |
| 11 | ``.. todo::`` markup. |
| 12 | |
| 13 | .. todo:: |
| 14 | |
| 15 | rewrite the hand written TODO by using the correct ``.. todo::`` |
| 16 | markup ;-). |
| 17 | |
| 18 | .. todolist:: |
diff --git a/sage/combinat/combinat.py b/sage/combinat/combinat.py
a
|
b
|
contains the following combinatorial fun |
189 | 189 | - matrix method of PermutationGroupElement yielding the |
190 | 190 | permutation matrix of the group element. |
191 | 191 | |
| 192 | .. TODO:: |
192 | 193 | |
193 | | :: |
194 | | |
195 | | TODO: |
196 | | GUAVA commands: |
197 | | * MOLS returns a list of n Mutually Orthogonal Latin Squares (MOLS). |
198 | | * VandermondeMat |
199 | | * GrayMat returns a list of all different vectors of length n over |
| 194 | GUAVA commands: |
| 195 | * MOLS returns a list of n Mutually Orthogonal Latin Squares (MOLS). |
| 196 | * VandermondeMat |
| 197 | * GrayMat returns a list of all different vectors of length n over |
200 | 198 | the field F, using Gray ordering. |
201 | | Not in GAP: |
| 199 | Not in GAP: |
202 | 200 | * Rencontres numbers |
203 | 201 | http://en.wikipedia.org/wiki/Rencontres_number |
204 | 202 | |
diff --git a/sage/combinat/ranker.py b/sage/combinat/ranker.py
a
|
b
|
def unrank_from_list(l): |
88 | 88 | def on_fly(): |
89 | 89 | """ |
90 | 90 | Returns a pair of enumeration functions rank / unrank. |
91 | | |
| 91 | |
92 | 92 | rank assigns on the fly an integer, starting from 0, to any object |
93 | 93 | passed as argument. The object should be hashable. unrank is the |
94 | 94 | inverse function; it returns None for indices that have not yet |
95 | 95 | been assigned. |
96 | | |
| 96 | |
97 | 97 | EXAMPLES:: |
98 | | |
| 98 | |
99 | 99 | sage: [rank, unrank] = sage.combinat.ranker.on_fly() |
100 | 100 | sage: rank('a') |
101 | 101 | 0 |
… |
… |
def on_fly(): |
112 | 112 | 3 |
113 | 113 | sage: unrank(3) |
114 | 114 | 'd' |
115 | | |
116 | | TODO: add tests as in combinat::rankers |
| 115 | |
| 116 | .. todo:: add tests as in combinat::rankers |
117 | 117 | """ |
118 | 118 | def count(): |
119 | 119 | i = 0 |
diff --git a/sage/misc/sagedoc.py b/sage/misc/sagedoc.py
a
|
b
|
def format(s, embedded=False): |
351 | 351 | 'identity_matrix>>>\n' |
352 | 352 | sage: format('<<<identity_matrix>>>')[:28] |
353 | 353 | 'Definition: identity_matrix(' |
| 354 | |
| 355 | TESTS: |
| 356 | |
| 357 | We check that the todo Sphinx extension is correctly activated:: |
| 358 | |
| 359 | sage: sage.misc.sagedoc.format(sage.combinat.ranker.on_fly.__doc__) |
| 360 | " Returns ... Todo: add tests as in combinat::rankers\n" |
354 | 361 | """ |
355 | 362 | if not isinstance(s, str): |
356 | 363 | raise TypeError, "s must be a string" |