Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
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
django
Commits
44f98f78
Kaydet (Commit)
44f98f78
authored
Agu 27, 2018
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced CVE/ticket roles with extlinks.
üst
7b7fb2ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
72 deletions
+6
-72
cve_role.py
docs/_ext/cve_role.py
+0
-27
ticket_role.py
docs/_ext/ticket_role.py
+0
-39
conf.py
docs/conf.py
+6
-6
No files found.
docs/_ext/cve_role.py
deleted
100644 → 0
Dosyayı görüntüle @
7b7fb2ec
"""
An interpreted text role to link docs to CVE issues. To use: :cve:`XXXXX`
"""
from
docutils
import
nodes
,
utils
from
docutils.parsers.rst
import
roles
def
cve_role
(
name
,
rawtext
,
text
,
lineno
,
inliner
,
options
=
None
,
content
=
None
):
if
options
is
None
:
options
=
{}
url_pattern
=
inliner
.
document
.
settings
.
env
.
app
.
config
.
cve_url
if
url_pattern
is
None
:
msg
=
inliner
.
reporter
.
warning
(
"cve not configured: please configure cve_url in conf.py"
)
prb
=
inliner
.
problematic
(
rawtext
,
rawtext
,
msg
)
return
[
prb
],
[
msg
]
url
=
url_pattern
%
text
roles
.
set_classes
(
options
)
node
=
nodes
.
reference
(
rawtext
,
utils
.
unescape
(
'CVE-
%
s'
%
text
),
refuri
=
url
,
**
options
)
return
[
node
],
[]
def
setup
(
app
):
app
.
add_config_value
(
'cve_url'
,
None
,
'env'
)
app
.
add_role
(
'cve'
,
cve_role
)
return
{
'parallel_read_safe'
:
True
}
docs/_ext/ticket_role.py
deleted
100644 → 0
Dosyayı görüntüle @
7b7fb2ec
"""
An interpreted text role to link docs to Trac tickets.
To use: :ticket:`XXXXX`
Based on code from psycopg2 by Daniele Varrazzo.
"""
from
docutils
import
nodes
,
utils
from
docutils.parsers.rst
import
roles
def
ticket_role
(
name
,
rawtext
,
text
,
lineno
,
inliner
,
options
=
None
,
content
=
None
):
if
options
is
None
:
options
=
{}
try
:
num
=
int
(
text
.
replace
(
'#'
,
''
))
except
ValueError
:
msg
=
inliner
.
reporter
.
error
(
"ticket number must be... a number, got '
%
s'"
%
text
)
prb
=
inliner
.
problematic
(
rawtext
,
rawtext
,
msg
)
return
[
prb
],
[
msg
]
url_pattern
=
inliner
.
document
.
settings
.
env
.
app
.
config
.
ticket_url
if
url_pattern
is
None
:
msg
=
inliner
.
reporter
.
warning
(
"ticket not configured: please configure ticket_url in conf.py"
)
prb
=
inliner
.
problematic
(
rawtext
,
rawtext
,
msg
)
return
[
prb
],
[
msg
]
url
=
url_pattern
%
num
roles
.
set_classes
(
options
)
node
=
nodes
.
reference
(
rawtext
,
'#'
+
utils
.
unescape
(
text
),
refuri
=
url
,
**
options
)
return
[
node
],
[]
def
setup
(
app
):
app
.
add_config_value
(
'ticket_url'
,
None
,
'env'
)
app
.
add_role
(
'ticket'
,
ticket_role
)
return
{
'parallel_read_safe'
:
True
}
docs/conf.py
Dosyayı görüntüle @
44f98f78
...
...
@@ -38,12 +38,16 @@ needs_sphinx = '1.6.0'
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions
=
[
"djangodocs"
,
'sphinx.ext.extlinks'
,
"sphinx.ext.intersphinx"
,
"sphinx.ext.viewcode"
,
"ticket_role"
,
"cve_role"
,
]
extlinks
=
{
'cve'
:
(
'https://nvd.nist.gov/view/vuln/detail?vulnId=
%
s'
,
'CVE-'
),
'ticket'
:
(
'https://code.djangoproject.com/ticket/
%
s'
,
'#'
),
}
# Spelling check needs an additional module that is not installed by default.
# Add it only if spelling check is requested so docs can be generated without it.
if
'spelling'
in
sys
.
argv
:
...
...
@@ -365,7 +369,3 @@ epub_cover = ('', 'epub-cover.html')
# If false, no index is generated.
# epub_use_index = True
# -- custom extension options --------------------------------------------------
cve_url
=
'https://nvd.nist.gov/view/vuln/detail?vulnId=
%
s'
ticket_url
=
'https://code.djangoproject.com/ticket/
%
s'
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