Ticket #12490: trac_12490-trac_role-fh.patch

File trac_12490-trac_role-fh.patch, 5.2 KB (added by hivert, 8 years ago)
  • doc/common/conf.py

    # HG changeset patch
    # User Florent Hivert <Florent.Hivert@univ-rouen.fr>
    # Date 1328956892 -3600
    # Node ID 05464c4b7cf0f5e9956774ba799556fe66bcadc2
    # Parent  d94cae411f9fb8b4650d1cb995cd6bf4965f26a4
    Create a role :trac: to link to trac ticket in 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', 'sphinx.ext.todo']
    18 #, 'sphinx.ext.intersphinx', 'sphinx.ext.extlinks']
     17              'sphinx.ext.inheritance_diagram', 'sphinx.ext.todo',
     18              'sphinx.ext.extlinks']
     19#, 'sphinx.ext.intersphinx']
     20
    1921
    2022if 'SAGE_DOC_JSMATH' in os.environ:
    2123    extensions.append('sphinx.ext.jsmath')
    inheritance_edge_attrs = {} 
    9698todo_include_todos = True
    9799
    98100
    99 # Sage trac ticket shortcuts. For example, :ticket:`7549` .
    100 #extlinks = {'ticket': ('http://trac.sagemath.org/sage_trac/ticket/', 'Ticket ')}
     101# Sage trac ticket shortcuts. For example, :trac:`7549` .
     102extlinks = {
     103    'trac': ('http://trac.sagemath.org/sage_trac/ticket/%s', 'trac ticket #'),
     104    'wikipedia': ('http://en.wikipedia.org/wiki/%s', 'Wikipedia article ')}
    101105
    102106# Options for HTML output
    103107# -----------------------
  • doc/en/developer/conventions.rst

    diff --git a/doc/en/developer/conventions.rst b/doc/en/developer/conventions.rst
    a b a guide. 
    418418  that reference under this block. The Sphinx/ReST markup for
    419419  citations is described at
    420420  http://sphinx.pocoo.org/rest.html#citations. See below for an example.
     421  Sage also add specific markup for links to sage trac tickets and
     422  Wikipedia. See :ref:`chapter-sage_manuals_links`.
    421423
    422424-  An AUTHORS block (optional, but encouraged for important
    423425   functions, so users can see from the docstring who wrote it and
  • doc/en/developer/sage_manuals.rst

    diff --git a/doc/en/developer/sage_manuals.rst b/doc/en/developer/sage_manuals.rst
    a b where ``<repo-name>`` is the name of the 
    8888when you run ``sage --docbuild --formats``).
    8989
    9090
    91 Setting hyperlink to modules, classes, methods, etc.
    92 ----------------------------------------------------
     91.. _chapter-sage_manuals_links:
     92
     93Linking to modules, classes, methods, ..., trac tickets and Wikipedia.
     94----------------------------------------------------------------------
    9395
    9496For full documentation, refer to `inline markup`__ in the Sphinx
    9597documentation. Currently, there is no support for defining chapters
    link produced and also without any error 
    152154the prepended dot, the object is searched starting from the top-level
    153155to the innermost module or class.
    154156
     157Sage adds a special role to link to trac ticket. The code ``:trac:`12490```
     158link to the :trac:`12490`. When fixing a bug, you should add the link to the
     159corresponding trac ticket in the ``TEST`` section. Here is an example::
     160
     161    TEST:
     162
     163    We check for :trac:`5534`::
     164
     165        sage: w = ["a", "b", "c", "d"]; ww = ["b", "d"]
     166        sage: x = sage.combinat.subword.smallest_positions(w, ww); ww
     167        ['b', 'd']
     168
     169If the same vein you can also add links to Wikipedia:
     170``:wikipedia:`Sage_(mathematics_software)``` add the following link to the
     171:wikipedia:`Sage_(mathematics_software)`
     172
    155173
    156174Adding a new file
    157175-----------------
  • sage/combinat/subword.py

    diff --git a/sage/combinat/subword.py b/sage/combinat/subword.py
    a b def smallest_positions(word, subword, po 
    305305        sage: sage.combinat.subword.smallest_positions([1,3,3,5,4,5,3,5],[3,5,3],3)
    306306        False
    307307
    308     TEST::
     308    TEST:
     309
     310    We check for :trac:`5534`::
    309311
    310312        sage: w = ["a", "b", "c", "d"]; ww = ["b", "d"]
    311         sage: x = sage.combinat.subword.smallest_positions(w, ww); ww # Trac #5534
     313        sage: x = sage.combinat.subword.smallest_positions(w, ww); ww
    312314        ['b', 'd']
    313315    """
    314316    pos -= 1
  • sage/graphs/graph.py

    diff --git a/sage/graphs/graph.py b/sage/graphs/graph.py
    a b class Graph(GenericGraph): 
    377377    Undirected graph.
    378378
    379379    A graph is a set of vertices connected by edges. See also the
    380     `Wikipedia article on graphs <http://en.wikipedia.org/wiki/Graph_(mathematics)>`_.
     380    :wikipedia:`Wikipedia article on graphs <Graph_(mathematics)>`.
    381381
    382382    One can very easily create a graph in Sage by typing::
    383    
     383
    384384        sage: g = Graph()
    385385
    386386    By typing the name of the graph, one can get some basic information
    class Graph(GenericGraph): 
    20982098    def strong_orientation(self):
    20992099        r"""
    21002100        Returns a strongly connected orientation of the current graph. See
    2101         also the
    2102         `Wikipedia article on strongly connected component <http://en.wikipedia.org/wiki/Strongly_connected_component>`_.
     2101        also the :wikipedia:`Strongly_connected_component`.
    21032102
    21042103        An orientation of an undirected graph is a digraph obtained by
    21052104        giving an unique direction to each of its edges. An orientation