Ticket #9128: trac_9128-doc_option-fh.patch

File trac_9128-doc_option-fh.patch, 3.7 KB (added by hivert, 8 years ago)
  • doc/common/build_options.py

    # HG changeset patch
    # User Florent Hivert <Florent.Hivert@univ-rouen.fr>
    # Date 1329756627 -3600
    # Node ID f11510bc52b1d3b2ae53a5589efece04eedddc7d
    # Parent  ff2003ec88bc70a7d8812689864661e80b56a54d
    [mq]: trac_9128-doc_option-fh.patch
    
    diff --git a/doc/common/build_options.py b/doc/common/build_options.py
    a b  
    55import os
    66SAGE_DOC = os.environ['SAGE_DOC']
    77LANGUAGES = ['de', 'en', 'fr', 'ru','tr']
    8 SPHINXOPTS = os.environ['SPHINXOPTS'] # -n = nit-picky = show dangling links
     8SPHINXOPTS = ""
    99PAPER = ""
    1010OMIT = ["introspect"]  # docs/dirs to omit when listing and building 'all'
    1111
  • doc/common/builder.py

    diff --git a/doc/common/builder.py b/doc/common/builder.py
    a b def setup_parser(): 
    954954    standard.add_option("--no-pdf-links", dest="no_pdf_links",
    955955                        action="store_true",
    956956                        help="do not include PDF links in DOCUMENT 'website'; FORMATs: html, json, pickle, web")
     957    standard.add_option("--warn-links", dest="warn_links",
     958                        default=False, action="store_true",
     959                        help="issue a warning whenever a link is not properly resolved; equivalent to '-S -n'")
    957960    standard.add_option("--check-nested", dest="check_nested",
    958961                        action="store_true",
    959962                        help="check picklability of nested classes in DOCUMENT 'reference'")
    if __name__ == '__main__': 
    10671070    if options.sphinx_opts:
    10681071        ALLSPHINXOPTS += options.sphinx_opts.replace(',', ' ') + " "
    10691072    if options.no_pdf_links:
    1070         ALLSPHINXOPTS += "-A hide_pdf_links=1"
     1073        ALLSPHINXOPTS += "-A hide_pdf_links=1 "
     1074    if options.warn_links:
     1075        ALLSPHINXOPTS += "-n "
     1076
    10711077
    10721078    # Make sure common/static exists.
    10731079    mkdir(os.path.join(SAGE_DOC, 'common', 'static'))
  • doc/en/developer/sage_manuals.rst

    diff --git a/doc/en/developer/sage_manuals.rst b/doc/en/developer/sage_manuals.rst
    a b name. For example, in the huge link 
    137137only ``".to_dyck_word()"`` will appear. Note that the parentheses in
    138138the link are autogenerated.
    139139
    140 Finally, local names are handled. That is, for example, in the
     140Local names are handled. That is, for example, in the
    141141definition of a class (and any of its members or methods), you can
    142142link to any member or method of the same class by simply giving the
    143143name of it prepended by a dot ``"."``. You do not need to give its
    link produced and also without any error 
    154154the prepended dot, the object is searched starting from the top-level
    155155to the innermost module or class.
    156156
     157You can also link, without giving the full path, to objects imported in a
     158local module or imported by default in Sage. For example, the two following
     159are equivalent, as :class:`Parent` is imported by default in Sage (using the
     160``all.py`` files)::
     161
     162    :class:`Parent`
     163    :class:`~sage.structure.parent.Parent`
     164
    157165Sage adds a special role to link to trac ticket. The code ``:trac:`12490```
    158166link to the :trac:`12490`. When fixing a bug, you should add the link to the
    159167corresponding trac ticket in the ``TEST`` section. Here is an example::
    If the same vein you can also add links  
    170178``:wikipedia:`Sage_(mathematics_software)``` add the following link to the
    171179:wikipedia:`Sage_(mathematics_software)`
    172180
     181.. note::
     182
     183    Finally, you can check that all links are properly resolved by adding the
     184    argument ``--warn-links`` to the documentation build command as in::
     185
     186        sage -docbuild --warn-links reference htm
     187
     188    In this case, when a link is not resolved Sphinx will issue a warning.
     189
    173190
    174191Adding a new file
    175192-----------------