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
08be2e2f
Kaydet (Commit)
08be2e2f
authored
Eki 22, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add a new directive marking up implementation details and start using it.
üst
4ebf8073
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
4 deletions
+39
-4
weakref.rst
Doc/library/weakref.rst
+4
-4
pyspecific.py
Doc/tools/sphinxext/pyspecific.py
+24
-0
basic.css
Doc/tools/sphinxext/static/basic.css
+11
-0
No files found.
Doc/library/weakref.rst
Dosyayı görüntüle @
08be2e2f
:mod:`weakref` --- Weak references
:mod:`weakref` --- Weak references
==================================
==================================
...
@@ -76,9 +75,10 @@ support weak references but can add support through subclassing::
...
@@ -76,9 +75,10 @@ support weak references but can add support through subclassing::
obj = Dict(red=1, green=2, blue=3) # this object is weak referenceable
obj = Dict(red=1, green=2, blue=3) # this object is weak referenceable
Other built-in types such as :class:`tuple` and :class:`long` do not support
.. impl-detail::
weak references even when subclassed (this is an implementation detail and may
be different across various Python implementations).
Other built-in types such as :class:`tuple` and :class:`long` do not support
weak references even when subclassed.
Extension types can easily be made to support weak references; see
Extension types can easily be made to support weak references; see
:ref:`weakref-support`.
:ref:`weakref-support`.
...
...
Doc/tools/sphinxext/pyspecific.py
Dosyayı görüntüle @
08be2e2f
...
@@ -35,6 +35,8 @@ from sphinx.locale import versionlabels
...
@@ -35,6 +35,8 @@ from sphinx.locale import versionlabels
HTMLTranslator
.
visit_versionmodified
=
new_visit_versionmodified
HTMLTranslator
.
visit_versionmodified
=
new_visit_versionmodified
# Support for marking up and linking to bugs.python.org issues
def
issue_role
(
typ
,
rawtext
,
text
,
lineno
,
inliner
,
options
=
{},
content
=
[]):
def
issue_role
(
typ
,
rawtext
,
text
,
lineno
,
inliner
,
options
=
{},
content
=
[]):
issue
=
utils
.
unescape
(
text
)
issue
=
utils
.
unescape
(
text
)
text
=
'issue '
+
issue
text
=
'issue '
+
issue
...
@@ -42,6 +44,25 @@ def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
...
@@ -42,6 +44,25 @@ def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
return
[
refnode
],
[]
return
[
refnode
],
[]
# Support for marking up implementation details
from
sphinx.util.compat
import
Directive
class
ImplementationDetail
(
Directive
):
has_content
=
True
required_arguments
=
0
optional_arguments
=
1
final_argument_whitespace
=
True
def
run
(
self
):
pnode
=
nodes
.
compound
(
classes
=
[
'impl-detail'
])
content
=
self
.
content
content
[
0
]
=
'**CPython implementation detail:** '
+
content
[
0
]
self
.
state
.
nested_parse
(
content
,
self
.
content_offset
,
pnode
)
return
[
pnode
]
# Support for building "topic help" for pydoc
# Support for building "topic help" for pydoc
pydoc_topic_labels
=
[
pydoc_topic_labels
=
[
...
@@ -110,10 +131,12 @@ class PydocTopicsBuilder(Builder):
...
@@ -110,10 +131,12 @@ class PydocTopicsBuilder(Builder):
finally
:
finally
:
f
.
close
()
f
.
close
()
# Support for checking for suspicious markup
# Support for checking for suspicious markup
import
suspicious
import
suspicious
# Support for documenting Opcodes
# Support for documenting Opcodes
import
re
import
re
...
@@ -136,6 +159,7 @@ def parse_opcode_signature(env, sig, signode):
...
@@ -136,6 +159,7 @@ def parse_opcode_signature(env, sig, signode):
def
setup
(
app
):
def
setup
(
app
):
app
.
add_role
(
'issue'
,
issue_role
)
app
.
add_role
(
'issue'
,
issue_role
)
app
.
add_directive
(
'impl-detail'
,
ImplementationDetail
)
app
.
add_builder
(
PydocTopicsBuilder
)
app
.
add_builder
(
PydocTopicsBuilder
)
app
.
add_builder
(
suspicious
.
CheckSuspiciousMarkupBuilder
)
app
.
add_builder
(
suspicious
.
CheckSuspiciousMarkupBuilder
)
app
.
add_description_unit
(
'opcode'
,
'opcode'
,
'
%
s (opcode)'
,
app
.
add_description_unit
(
'opcode'
,
'opcode'
,
'
%
s (opcode)'
,
...
...
Doc/tools/sphinxext/static/basic.css
Dosyayı görüntüle @
08be2e2f
...
@@ -345,6 +345,17 @@ p.deprecated {
...
@@ -345,6 +345,17 @@ p.deprecated {
background-color
:
#ffa
background-color
:
#ffa
}
}
.impl-detail
{
margin-top
:
10px
;
margin-bottom
:
10px
;
padding
:
7px
;
border
:
1px
solid
#ccc
;
}
.impl-detail
p
{
margin
:
0
;
}
/* -- code displays --------------------------------------------------------- */
/* -- code displays --------------------------------------------------------- */
pre
{
pre
{
...
...
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