[docs] Adds sphinx.ext.viewcode

This commit is contained in:
Ask Solem 2016-04-06 12:14:30 -07:00
parent d6eb370df7
commit 646ef049b4
1 changed files with 17 additions and 1 deletions

View File

@ -31,6 +31,22 @@ extensions = [
'githubsphinx',
]
LINKCODE_URL = 'https://github.com/{proj}/tree/{branch}/{filename}.py'
GITHUB_PROJECT = 'celery/kombu'
GITHUB_BRANCH = 'master'
def linkcode_resolve(domain, info):
if domain != 'py' or not info['module']:
return
filename = info['module'].replace('.', '/')
return LINKCODE_URL.format(
proj=GITHUB_PROJECT,
branch=GITHUB_BRANCH,
filename=filename,
)
# Add any paths that contain templates here, relative to this directory.
templates_path = ['.templates']
@ -89,7 +105,7 @@ html_sidebars = {
# ## Issuetracker
github_project = 'celery/kombu'
github_project = GITHUB_PROJECT
intersphinx_mapping = {
'python': ('http://docs.python.org/dev', None),