diff --git a/doc/_themes/odoodoc/github.py b/doc/_themes/odoodoc/github.py index ec6bba3c866..4c5087b60ab 100644 --- a/doc/_themes/odoodoc/github.py +++ b/doc/_themes/odoodoc/github.py @@ -2,7 +2,6 @@ import inspect import importlib import os.path from urlparse import urlunsplit -import sphinx def setup(app): app.add_config_value('github_user', None, 'env') @@ -73,13 +72,6 @@ def add_doc_link(app, pagename, templatename, context, doctree): if not app.config.github_user and app.config.github_project: return - def github_doc_link(mode='blob'): - """ returns the github URL for the current page - - :param str mode: 'edit' for edition view - """ - return make_github_link( - app, - 'doc/%s%s' % (pagename, app.config.source_suffix), - mode=mode) - context['github_link'] = github_doc_link + # can't use functools.partial because 3rd positional is line not mode + context['github_link'] = lambda mode='mode': make_github_link( + app, 'doc/%s%s' % (pagename, app.config.source_suffix), mode=mode) diff --git a/doc/_themes/odoodoc/layout.html b/doc/_themes/odoodoc/layout.html index d541256746d..8abb3fd7b69 100644 --- a/doc/_themes/odoodoc/layout.html +++ b/doc/_themes/odoodoc/layout.html @@ -34,8 +34,8 @@ {{ toctree(maxdepth=4, collapse=False, includehidden=True, main_navbar=False, titles_only=False) }} {% if github_link %} -

- View on GitHub +

+ Edit on GitHub

{% endif %}