{# Adapted from https://github.com/pradyunsg/furo/blob/main/src/furo/theme/furo/components/edit-this-page.html Required to properly link the edit button in the examples from the doc to source document in the github repo. #} {% extends "basic-ng/components/edit-this-page.html" %} {% from "basic-ng/components/edit-this-page.html" import determine_page_edit_link with context %} {%- macro furo_edit_button(url) -%} {%- if 'doc/auto_examples' in url -%} {% set url=url|replace("doc/auto_examples", "examples")|replace(".rst", ".py")|replace("index.py", "README.rst") %} {%- endif -%}
{{ _("Edit this page") }}
{%- endmacro -%} {% block link_available -%} {{ furo_edit_button(determine_page_edit_link()) }} {%- endblock %} {% block link_not_available %} {# Make nice things happen, on Read the Docs #} {%- if READTHEDOCS and conf_py_path and page_source_suffix and github_user != "None" and github_repo != "None" and github_version and pagename and page_source_suffix %} {% set url = "https://github.com/" + github_user + "/" + github_repo + "/edit/" + github_version + conf_py_path + pagename + page_source_suffix %} {{ furo_edit_button(url) }} {%- endif -%} {% endblock %}