Ticket #11251: trac_11251-sphinx_todo_extension-fh.patch

File trac_11251-sphinx_todo_extension-fh.patch, 6.3 KB (added by hivert, 11 years ago)
  • doc/common/conf.py

    # 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. 
    1414# Add any Sphinx extension module names here, as strings. They can be extensions
    1515# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
    1616extensions = ['sage_autodoc',  'sphinx.ext.graphviz',
    17               'sphinx.ext.inheritance_diagram']
     17              'sphinx.ext.inheritance_diagram', 'sphinx.ext.todo']
    1818#, 'sphinx.ext.intersphinx', 'sphinx.ext.extlinks']
    1919
    2020if 'SAGE_DOC_JSMATH' in os.environ:
    inheritance_graph_attrs = { 'rankdir' :  
    8989inheritance_node_attrs = { 'height' : 0.5, 'fontsize' : 12, 'shape' : 'oval' }
    9090inheritance_edge_attrs = {}
    9191
     92# Extension configuration
     93# -----------------------
     94
     95# include the todos
     96todo_include_todos = True
     97
     98
    9299# Sage trac ticket shortcuts. For example, :ticket:`7549` .
    93100#extlinks = {'ticket': ('http://trac.sagemath.org/sage_trac/ticket/', 'Ticket ')}
    94101
  • doc/common/themes/sage/static/sage.css_t

    diff --git a/doc/common/themes/sage/static/sage.css_t b/doc/common/themes/sage/static/sage.css_t
    a b div.note { 
    205205    border: 1px solid #ccc;
    206206}
    207207
     208div.admonition-todo {
     209    background-color: #eee;
     210    border: 1px solid #ccc;
     211}
     212
    208213div.seealso {
    209214    background-color: #ffc;
    210215    border: 1px solid #ff6;
  • doc/en/developer/conventions.rst

    diff --git a/doc/en/developer/conventions.rst b/doc/en/developer/conventions.rst
    a b a guide. 
    397397          build, it is very likely that you would be requested to
    398398          change your patch.
    399399
     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
    400414- A REFERENCES block to list books or papers (optional). This block serves
    401415  a similar purpose to a list of references in a research paper, or a
    402416  bibliography in a monograph. If your method, function or class uses an
  • doc/en/introspect/conf.py

    diff --git a/doc/en/introspect/conf.py b/doc/en/introspect/conf.py
    a b import sys, os 
    66sys.path.append(os.environ['SAGE_DOC'])
    77from common.conf import *
    88
    9 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.jsmath']
     9extensions = ['sphinx.ext.autodoc', 'sphinx.ext.jsmath', 'sphinx.ext.todo']
    1010
    1111templates_path = ['templates']
    1212html_static_path = ['static']
    html_use_modindex = False 
    1515html_use_index = False
    1616html_split_index = False
    1717html_copy_source = False
     18
     19todo_include_todos = True
  • doc/en/reference/index.rst

    diff --git a/doc/en/reference/index.rst b/doc/en/reference/index.rst
    a b Enjoy Sage! 
    9393   modmisc
    9494   tensor
    9595
     96   todolist
     97
    9698   history_and_license
    9799
    98100Indices and tables
  • new file doc/en/reference/todolist.rst

    diff --git a/doc/en/reference/todolist.rst b/doc/en/reference/todolist.rst
    new file mode 100644
    - +  
     1.. _ch:todolist:
     2
     3SAGE's To Do list
     4=================
     5
     6There 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::
  • sage/combinat/combinat.py

    diff --git a/sage/combinat/combinat.py b/sage/combinat/combinat.py
    a b contains the following combinatorial fun 
    189189-  matrix method of PermutationGroupElement yielding the
    190190   permutation matrix of the group element.
    191191
     192.. TODO::
    192193
    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
    200198          the field F, using Gray ordering.
    201        Not in GAP:
     199    Not in GAP:
    202200        * Rencontres numbers
    203201          http://en.wikipedia.org/wiki/Rencontres_number
    204202
  • sage/combinat/ranker.py

    diff --git a/sage/combinat/ranker.py b/sage/combinat/ranker.py
    a b def unrank_from_list(l): 
    8888def on_fly():
    8989    """
    9090    Returns a pair of enumeration functions rank / unrank.
    91    
     91
    9292    rank assigns on the fly an integer, starting from 0, to any object
    9393    passed as argument. The object should be hashable. unrank is the
    9494    inverse function; it returns None for indices that have not yet
    9595    been assigned.
    96    
     96
    9797    EXAMPLES::
    98    
     98
    9999        sage: [rank, unrank] = sage.combinat.ranker.on_fly()
    100100        sage: rank('a')
    101101        0
    def on_fly(): 
    112112        3
    113113        sage: unrank(3)
    114114        'd'
    115    
    116     TODO: add tests as in combinat::rankers
     115
     116    .. todo:: add tests as in combinat::rankers
    117117    """
    118118    def count():
    119119        i = 0
  • sage/misc/sagedoc.py

    diff --git a/sage/misc/sagedoc.py b/sage/misc/sagedoc.py
    a b def format(s, embedded=False): 
    351351        'identity_matrix>>>\n'
    352352        sage: format('<<<identity_matrix>>>')[:28]
    353353        '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"
    354361    """
    355362    if not isinstance(s, str):
    356363        raise TypeError, "s must be a string"