Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
68818863
Commit
68818863
authored
Nov 06, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#10334: add a role to refer to Python source files in SVN.
parent
1cb25aa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
Doc/tools/sphinxext/pyspecific.py
Doc/tools/sphinxext/pyspecific.py
+13
-0
No files found.
Doc/tools/sphinxext/pyspecific.py
View file @
68818863
...
...
@@ -10,8 +10,10 @@
"""
ISSUE_URI
=
'http://bugs.python.org/issue%s'
SOURCE_URI
=
'http://svn.python.org/view/python/branches/py3k/%s?view=markup'
from
docutils
import
nodes
,
utils
from
sphinx.util.nodes
import
split_explicit_title
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
from
docutils.parsers.rst.states
import
Body
...
...
@@ -44,6 +46,16 @@ def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
return
[
refnode
],
[]
# Support for linking to Python source files easily
def
source_role
(
typ
,
rawtext
,
text
,
lineno
,
inliner
,
options
=
{},
content
=
[]):
has_t
,
title
,
target
=
split_explicit_title
(
text
)
title
=
utils
.
unescape
(
title
)
target
=
utils
.
unescape
(
target
)
refnode
=
nodes
.
reference
(
title
,
title
,
refuri
=
SOURCE_URI
%
target
)
return
[
refnode
],
[]
# Support for marking up implementation details
from
sphinx.util.compat
import
Directive
...
...
@@ -214,6 +226,7 @@ def parse_pdb_command(env, sig, signode):
def setup(app):
app.add_role('
issue
', issue_role)
app.add_role('
source
', source_role)
app.add_directive('
impl
-
detail
', ImplementationDetail)
app.add_builder(PydocTopicsBuilder)
app.add_builder(suspicious.CheckSuspiciousMarkupBuilder)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment