#9128: Sphinx should be aware of all.py to find its links
-----------------------------+----------------------------------------------
Reporter: hivert | Owner: hivert
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.0
Component: documentation | Keywords: Sphinx links
Work_issues: | Upstream: N/A
Reviewer: | Author: Florent Hivert
Merged: | Dependencies: #11251, #12490
-----------------------------+----------------------------------------------
Comment(by hivert):
I just added the following diff which should resolve many more dependance
to python itself.
{{{
#!diff
diff --git a/doc/common/conf.py b/doc/common/conf.py
--- a/doc/common/conf.py
+++ b/doc/common/conf.py
@@ -490,6 +490,11 @@ def call_intersphinx(app, env, node, con
debug_inf(app, "---- Intersphinx: %s not
Found"%node['reftarget'])
return res
+# lists of basic Python class which are documented as functions
+base_class_as_func = [
+ 'bool', 'complex', 'dict', 'file', 'float',
+ 'frozenset', 'int', 'list', 'long', 'object',
+ 'set', 'slice', 'str', 'tuple', 'type', 'unicode', 'xrange']
def find_sage_dangling_links(app, env, node, contnode):
"""
@@ -507,9 +512,9 @@ def find_sage_dangling_links(app, env, n
debug_inf(app, "Searching %s from %s"%(reftarget, doc))
- # Workaround: in Python's doc 'object' is documented as a function
rather
- # than a class
- if reftarget == 'object' and reftype == 'class':
+ # Workaround: in Python's doc 'object', 'list', ... are documented as
a
+ # function rather than a class
+ if reftarget in base_class_as_func and reftype == 'class':
node['reftype'] = 'func'
res = call_intersphinx(app, env, node, contnode)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9128#comment:43>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.