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
b682fd3d
Kaydet (Commit)
b682fd3d
authored
Eyl 22, 2014
tarafından
Ned Deily
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21431: merge from 3.4
üst
4bd60980
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
27 deletions
+7
-27
conf.py
Doc/conf.py
+1
-1
pyspecific.py
Doc/tools/sphinxext/pyspecific.py
+6
-26
No files found.
Doc/conf.py
Dosyayı görüntüle @
b682fd3d
...
...
@@ -61,7 +61,7 @@ add_module_names = True
# By default, highlight as Python 3.
highlight_language
=
'python3'
needs_sphinx
=
'1.
1
'
needs_sphinx
=
'1.
2
'
# Options for HTML output
...
...
Doc/tools/sphinxext/pyspecific.py
Dosyayı görüntüle @
b682fd3d
...
...
@@ -14,12 +14,10 @@ SOURCE_URI = 'https://hg.python.org/cpython/file/default/%s'
from
docutils
import
nodes
,
utils
import
sphinx
from
sphinx.util.nodes
import
split_explicit_title
from
sphinx.util.compat
import
Directive
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
...
...
@@ -28,20 +26,6 @@ Body.enum.converters['loweralpha'] = \
Body
.
enum
.
converters
[
'lowerroman'
]
=
\
Body
.
enum
.
converters
[
'upperroman'
]
=
lambda
x
:
None
SPHINX11
=
sphinx
.
__version__
[:
3
]
<
'1.2'
if
SPHINX11
:
# 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
orig_visit_literal_block
=
HTMLTranslator
.
visit_literal_block
...
...
@@ -174,10 +158,9 @@ class DeprecatedRemoved(Directive):
content
.
line
=
node
[
0
]
.
line
content
+=
node
[
0
]
.
children
node
[
0
]
.
replace_self
(
nodes
.
paragraph
(
''
,
''
,
content
))
if
not
SPHINX11
:
node
[
0
]
.
insert
(
0
,
nodes
.
inline
(
''
,
'
%
s: '
%
text
,
classes
=
[
'versionmodified'
]))
el
if
not
SPHINX11
:
el
se
:
para
=
nodes
.
paragraph
(
''
,
''
,
nodes
.
inline
(
''
,
'
%
s.'
%
text
,
classes
=
[
'versionmodified'
]))
if
len
(
node
):
...
...
@@ -188,9 +171,6 @@ class DeprecatedRemoved(Directive):
env
.
note_versionchange
(
'deprecated'
,
version
[
0
],
node
,
self
.
lineno
)
return
[
node
]
+
messages
# for Sphinx < 1.2
versionlabels
[
'deprecated-removed'
]
=
DeprecatedRemoved
.
_label
# Support for including Misc/NEWS
...
...
@@ -289,14 +269,14 @@ class PydocTopicsBuilder(Builder):
document
.
append
(
doctree
.
ids
[
labelid
])
destination
=
StringOutput
(
encoding
=
'utf-8'
)
writer
.
write
(
document
,
destination
)
self
.
topics
[
label
]
=
writer
.
output
.
encode
(
'utf-8'
)
self
.
topics
[
label
]
=
writer
.
output
def
finish
(
self
):
f
=
open
(
path
.
join
(
self
.
outdir
,
'topics.py'
),
'w'
)
f
=
open
(
path
.
join
(
self
.
outdir
,
'topics.py'
),
'w
b
'
)
try
:
f
.
write
(
'# -*- coding: utf-8 -*-
\n
'
)
f
.
write
(
'# Autogenerated by Sphinx on
%
s
\n
'
%
asctime
(
))
f
.
write
(
'topics = '
+
pformat
(
self
.
topics
)
+
'
\n
'
)
f
.
write
(
'# -*- coding: utf-8 -*-
\n
'
.
encode
(
'utf-8'
)
)
f
.
write
(
(
'# Autogenerated by Sphinx on
%
s
\n
'
%
asctime
())
.
encode
(
'utf-8'
))
f
.
write
(
(
'topics = '
+
pformat
(
self
.
topics
)
+
'
\n
'
)
.
encode
(
'utf-8'
)
)
finally
:
f
.
close
()
...
...
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