Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel LiteX
migen
Commits
b008f1d3
Commit
b008f1d3
authored
7 years ago
by
Tim 'mithro' Ansell
Committed by
Sébastien Bourdeauducq
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
doc: Adding links to github code.
parent
218a3182
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
doc/conf.py
doc/conf.py
+64
-0
No files found.
doc/conf.py
View file @
b008f1d3
...
@@ -223,3 +223,67 @@ man_pages = [
...
@@ -223,3 +223,67 @@ man_pages = [
(
'index'
,
'migen'
,
u
'Migen manual'
,
(
'index'
,
'migen'
,
u
'Migen manual'
,
[
u
'Sebastien Bourdeauducq'
],
1
)
[
u
'Sebastien Bourdeauducq'
],
1
)
]
]
# -- Options for links to the code ---------------------------------------------
# Taken from numpy - https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L273
import
inspect
from
os.path
import
relpath
,
dirname
for
name
in
[
'sphinx.ext.linkcode'
,
'numpydoc.linkcode'
]:
try
:
__import__
(
name
)
extensions
.
append
(
name
)
break
except
ImportError
:
pass
else
:
print
(
"NOTE: linkcode extension not found -- no links to source generated"
)
def
linkcode_resolve
(
domain
,
info
):
"""
Determine the URL corresponding to Python object
"""
if
domain
!=
'py'
:
return
None
modname
=
info
[
'module'
]
fullname
=
info
[
'fullname'
]
submod
=
sys
.
modules
.
get
(
modname
)
if
submod
is
None
:
return
None
obj
=
submod
for
part
in
fullname
.
split
(
'.'
):
try
:
obj
=
getattr
(
obj
,
part
)
except
:
return
None
try
:
fn
=
inspect
.
getsourcefile
(
obj
)
except
:
fn
=
None
if
not
fn
:
return
None
try
:
source
,
lineno
=
inspect
.
getsourcelines
(
obj
)
except
:
lineno
=
None
if
lineno
:
linespec
=
"#L%d-L%d"
%
(
lineno
,
lineno
+
len
(
source
)
-
1
)
else
:
linespec
=
""
fn
=
relpath
(
fn
,
start
=
dirname
(
numpy
.
__file__
))
if
'dev'
in
numpy
.
__version__
:
return
"http://github.com/m-labs/migen/blob/master/migen/%s%s"
%
(
fn
,
linespec
)
else
:
return
"http://github.com/m-labs/migen/blob/v%s/migen/%s%s"
%
(
numpy
.
__version__
,
fn
,
linespec
)
This diff is collapsed.
Click to expand it.
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