diff --git a/_ext/edit_on_github.py b/_ext/edit_on_github.py deleted file mode 100644 index 6c8aca1d..00000000 --- a/_ext/edit_on_github.py +++ /dev/null @@ -1,42 +0,0 @@ -""" -Sphinx extension to add ReadTheDocs-style "Edit on GitHub" links to the -sidebar. - -Loosely based on https://github.com/astropy/astropy/pull/347 -""" - -import os -import warnings - - -__licence__ = 'BSD (3 clause)' - - -def get_github_url(app, view, path): - return 'https://github.com/{project}/{view}/{branch}/{path}'.format( - project=app.config.edit_on_github_project, - view=view, - branch=app.config.edit_on_github_branch, - path=path) - - -def html_page_context(app, pagename, templatename, context, doctree): - if templatename != 'page.html': - return - - if not app.config.edit_on_github_project: - warnings.warn("edit_on_github_project not specified") - return - - path = os.path.relpath(doctree.get('source'), app.builder.srcdir) - show_url = get_github_url(app, 'blob', path) - edit_url = get_github_url(app, 'edit', path) - - # context['show_on_github_url'] = show_url - context['edit_on_github_url'] = edit_url - - -def setup(app): - app.add_config_value('edit_on_github_project', '', True) - app.add_config_value('edit_on_github_branch', 'master', True) - app.connect('html-page-context', html_page_context) diff --git a/conf.py b/conf.py index cf229861..3335f0eb 100644 --- a/conf.py +++ b/conf.py @@ -41,7 +41,6 @@ 'sphinxcontrib.bibtex', 'sphinx_rtd_theme', 'matplotlib.sphinxext.plot_directive', - 'edit_on_github', 'purpose', 'question', 'geosciapp', @@ -84,7 +83,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = "en" +language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: @@ -159,11 +158,6 @@ # number figures numfig = True -# -- Edit on Github Extension --------------------------------------------- - -edit_on_github_project = 'geoscixyz/em' -edit_on_github_branch = 'main' - # -- Options for HTML output ---------------------------------------------- @@ -172,13 +166,13 @@ import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' -# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] -# html_context = { -# 'display_github': True, -# 'github_user': 'geoscixyz', -# 'github_repo': 'em', -# 'github_version': 'main' -# } +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_context = { + 'display_github': True, + 'github_user': 'geoscixyz', + 'github_repo': 'em', + 'github_version': 'main' +} # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". html_title = 'Electromagnetic Geophysics'