Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e9bd31f9
Kaydet (Commit)
e9bd31f9
authored
Eki 12, 2013
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge with 3.3
üst
5a5d73a3
239990da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
pyspecific.py
Doc/tools/sphinxext/pyspecific.py
+17
-16
No files found.
Doc/tools/sphinxext/pyspecific.py
Dosyayı görüntüle @
e9bd31f9
...
...
@@ -5,7 +5,7 @@
Sphinx extension with Python doc-specific markup.
:copyright: 2008
, 2009, 2010, 2011, 2012
by Georg Brandl.
:copyright: 2008
-2013
by Georg Brandl.
:license: Python license.
"""
...
...
@@ -13,7 +13,12 @@ ISSUE_URI = 'http://bugs.python.org/issue%s'
SOURCE_URI
=
'http://hg.python.org/cpython/file/default/
%
s'
from
docutils
import
nodes
,
utils
import
sphinx
from
sphinx.util.nodes
import
split_explicit_title
from
sphinx.writers.html
import
HTMLTranslator
from
sphinx.writers.latex
import
LaTeXTranslator
from
sphinx.locale
import
versionlabels
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
from
docutils.parsers.rst.states
import
Body
...
...
@@ -22,21 +27,17 @@ Body.enum.converters['loweralpha'] = \
Body
.
enum
.
converters
[
'lowerroman'
]
=
\
Body
.
enum
.
converters
[
'upperroman'
]
=
lambda
x
:
None
# monkey-patch HTML translator to give versionmodified paragraphs a class
def
new_visit_versionmodified
(
self
,
node
):
self
.
body
.
append
(
self
.
starttag
(
node
,
'p'
,
CLASS
=
node
[
'type'
]))
text
=
versionlabels
[
node
[
'type'
]]
%
node
[
'version'
]
if
len
(
node
):
text
+=
':'
else
:
text
+=
'.'
self
.
body
.
append
(
'<span class="versionmodified">
%
s</span> '
%
text
)
from
sphinx.writers.html
import
HTMLTranslator
from
sphinx.writers.latex
import
LaTeXTranslator
from
sphinx.locale
import
versionlabels
HTMLTranslator
.
visit_versionmodified
=
new_visit_versionmodified
HTMLTranslator
.
visit_versionmodified
=
new_visit_versionmodified
if
sphinx
.
__version__
[:
3
]
<
'1.2'
:
# monkey-patch HTML translator to give versionmodified paragraphs a class
def
new_visit_versionmodified
(
self
,
node
):
self
.
body
.
append
(
self
.
starttag
(
node
,
'p'
,
CLASS
=
node
[
'type'
]))
text
=
versionlabels
[
node
[
'type'
]]
%
node
[
'version'
]
if
len
(
node
):
text
+=
':'
else
:
text
+=
'.'
self
.
body
.
append
(
'<span class="versionmodified">
%
s</span> '
%
text
)
HTMLTranslator
.
visit_versionmodified
=
new_visit_versionmodified
# monkey-patch HTML and LaTeX translators to keep doctest blocks in the
# doctest docs themselves
...
...
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