Ticket #12869: trac_12869-nitpick_improve-fh.2.patch

File trac_12869-nitpick_improve-fh.2.patch, 2.5 KB (added by novoselt, 11 years ago)

Typo fixes

  • doc/common/conf.py

    # HG changeset patch
    # User Florent Hivert <Florent.Hivert@univ-rouen.fr>
    # Date 1335178923 -7200
    # Node ID 78f4b912a3667c70581a6662062824689c21e883
    # Parent  4f3a655857aa2a3b7f9925d78abadb7fdc209062
    The warn-links option shouldn't allways triggers full doc compilation.
    
    diff --git a/doc/common/conf.py b/doc/common/conf.py
    a b def call_intersphinx(app, env, node, con 
    490490        debug_inf(app, "---- Intersphinx: %s not Found"%node['reftarget'])
    491491    return res
    492492
    493 # lists of basic Python class which are documented as functions
    494 base_class_as_func = [
    495     'bool', 'complex', 'dict', 'file', 'float',
    496     'frozenset', 'int', 'list', 'long', 'object',
    497     'set', 'slice', 'str', 'tuple', 'type', 'unicode', 'xrange']
    498 
    499493def find_sage_dangling_links(app, env, node, contnode):
    500494    """
    501495    Try to find dangling link in local module imports or all.py.
    def find_sage_dangling_links(app, env, n 
    576570    newnode.append(contnode)
    577571    return newnode
    578572
     573# lists of basic Python class which are documented as functions
     574base_class_as_func = [
     575    'bool', 'complex', 'dict', 'file', 'float',
     576    'frozenset', 'int', 'list', 'long', 'object',
     577    'set', 'slice', 'str', 'tuple', 'type', 'unicode', 'xrange']
     578
     579# Nit picky option configuration: Put here broken links we want to ignore. For
     580# link to the Python documentation several links where broken because there
     581# where class listed as functions. Expand the list 'base_class_as_func'
     582# above instead of marking the link as broken.
     583nitpick_ignore = (
     584    ('py:class', 'twisted.web2.resource.Resource'),
     585    ('py:class', 'twisted.web2.resource.PostableResource'))
     586
     587def nitpick_patch_config(app):
     588    """
     589    Patch the default config for nitpicky
     590
     591    Calling path_config ensure that nitpicky is not considered as a Sphinx
     592    environment variable but rather as a Sage environment variable. As a
     593    consequence, changing it doesn't force the recompilation of the entire
     594    documentation.
     595    """
     596    app.config.values['nitpicky'] = (False, 'sage')
     597    app.config.values['nitpick_ignore'] = ([], 'sage')
     598
    579599from sage.misc.sageinspect import sage_getargspec
    580600autodoc_builtin_argspec = sage_getargspec
    581601
    def setup(app): 
    597617    import sphinx.ext.intersphinx
    598618    app.connect('builder-inited', set_intersphinx_mappings)
    599619    app.connect('builder-inited', sphinx.ext.intersphinx.load_mappings)
     620    app.connect('builder-inited', nitpick_patch_config)
    600621