diff --git a/src/doc/ca/intro/conf.py b/src/doc/ca/intro/conf.py index e46ebfb8c8d..71d81dcdbf3 100644 --- a/src/doc/ca/intro/conf.py +++ b/src/doc/ca/intro/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/ca/intro', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/ca/intro', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/ca/intro', '{filename}'), }) # General information about the project. diff --git a/src/doc/de/a_tour_of_sage/conf.py b/src/doc/de/a_tour_of_sage/conf.py index 33f9e9642b7..71fc7ef9012 100644 --- a/src/doc/de/a_tour_of_sage/conf.py +++ b/src/doc/de/a_tour_of_sage/conf.py @@ -22,9 +22,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/de/a_tour_of_sage', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/de/a_tour_of_sage', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/de/a_tour_of_sage', '{filename}'), }) # General information about the project. diff --git a/src/doc/de/thematische_anleitungen/conf.py b/src/doc/de/thematische_anleitungen/conf.py index d3a843c30bd..337f1a98c68 100644 --- a/src/doc/de/thematische_anleitungen/conf.py +++ b/src/doc/de/thematische_anleitungen/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/de/thematische_anleitungen', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/de/thematische_anleitungen', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/de/thematische_anleitungen', '{filename}'), }) # General information about the project. diff --git a/src/doc/de/tutorial/conf.py b/src/doc/de/tutorial/conf.py index fe4c5b0d3e1..399a915e9f4 100644 --- a/src/doc/de/tutorial/conf.py +++ b/src/doc/de/tutorial/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/de/tutorial', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/de/tutorial', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/de/tutorial', '{filename}'), }) # General information about the project. diff --git a/src/doc/en/a_tour_of_sage/conf.py b/src/doc/en/a_tour_of_sage/conf.py index 38184747c9f..7cf31297409 100644 --- a/src/doc/en/a_tour_of_sage/conf.py +++ b/src/doc/en/a_tour_of_sage/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, f'blob/develop/src/doc/en/a_tour_of_sage', '{filename}'), + 'source_view_link': os.path.join(source_repository, f'blob/develop/src/doc/en/a_tour_of_sage', '{filename}'), + 'source_edit_link': os.path.join(source_repository, f'edit/develop/src/doc/en/a_tour_of_sage', '{filename}'), }) # General information about the project. diff --git a/src/doc/en/constructions/conf.py b/src/doc/en/constructions/conf.py index 13743e5b276..b6bbbbaab3b 100644 --- a/src/doc/en/constructions/conf.py +++ b/src/doc/en/constructions/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/en/constructions', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/en/constructions', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/en/constructions', '{filename}'), }) # General information about the project. diff --git a/src/doc/en/developer/conf.py b/src/doc/en/developer/conf.py index 58e0ca995b7..e8877d61770 100644 --- a/src/doc/en/developer/conf.py +++ b/src/doc/en/developer/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/en/developer', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/en/developer', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/en/developer', '{filename}'), }) # General information about the project. diff --git a/src/doc/en/faq/conf.py b/src/doc/en/faq/conf.py index fab823b6592..4c8a71bd9d1 100644 --- a/src/doc/en/faq/conf.py +++ b/src/doc/en/faq/conf.py @@ -22,9 +22,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/en/faq', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/en/faq', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/en/faq', '{filename}'), }) # General information about the project. diff --git a/src/doc/en/installation/conf.py b/src/doc/en/installation/conf.py index 41f91e228d0..ea6956d2678 100644 --- a/src/doc/en/installation/conf.py +++ b/src/doc/en/installation/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/en/installation', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/en/installation', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/en/installation', '{filename}'), }) # General information about the project. diff --git a/src/doc/en/prep/conf.py b/src/doc/en/prep/conf.py index 3dc26674397..645d451644d 100644 --- a/src/doc/en/prep/conf.py +++ b/src/doc/en/prep/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/en/prep', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/en/prep', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/en/prep', '{filename}'), }) # General information about the project. diff --git a/src/doc/en/reference/conf.py b/src/doc/en/reference/conf.py index d9bb5da5acb..984c43363f2 100644 --- a/src/doc/en/reference/conf.py +++ b/src/doc/en/reference/conf.py @@ -25,9 +25,10 @@ ref_src = os.path.join(SAGE_DOC_SRC, 'en', 'reference') ref_out = os.path.join(SAGE_DOC, 'html', 'en', 'reference') -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/en/reference/index.rst'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/en/reference/index.rst'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/en/reference/index.rst'), }) # General information about the project. diff --git a/src/doc/en/reference/conf_sub.py b/src/doc/en/reference/conf_sub.py index 8346b13c9f4..479e9c306d2 100644 --- a/src/doc/en/reference/conf_sub.py +++ b/src/doc/en/reference/conf_sub.py @@ -42,9 +42,10 @@ title = name.capitalize() title = title.replace('`', '$') -# We use the directory's name to add a small edit button. +# We use the directory's name to add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, f'blob/develop/src/doc/en/reference/{name}', '{filename}'), + 'source_view_link': os.path.join(source_repository, f'blob/develop/src/doc/en/reference/{name}', '{filename}'), + 'source_edit_link': os.path.join(source_repository, f'edit/develop/src/doc/en/reference/{name}', '{filename}'), }) # General information about the project. diff --git a/src/doc/en/thematic_tutorials/conf.py b/src/doc/en/thematic_tutorials/conf.py index 19f9a3da5af..cb6d1662f47 100644 --- a/src/doc/en/thematic_tutorials/conf.py +++ b/src/doc/en/thematic_tutorials/conf.py @@ -22,9 +22,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/en/thematic_tutorials', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/en/thematic_tutorials', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/en/thematic_tutorials', '{filename}'), }) # General information about the project. diff --git a/src/doc/en/tutorial/conf.py b/src/doc/en/tutorial/conf.py index 7b475a3bb6e..b566ec19677 100644 --- a/src/doc/en/tutorial/conf.py +++ b/src/doc/en/tutorial/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/en/tutorial', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/en/tutorial', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/en/tutorial', '{filename}'), }) # General information about the project. diff --git a/src/doc/es/a_tour_of_sage/conf.py b/src/doc/es/a_tour_of_sage/conf.py index b6f43afd2da..dee2afa4d66 100644 --- a/src/doc/es/a_tour_of_sage/conf.py +++ b/src/doc/es/a_tour_of_sage/conf.py @@ -22,9 +22,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/es/a_tour_of_sage', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/es/a_tour_of_sage', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/es/a_tour_of_sage', '{filename}'), }) # General information about the project. diff --git a/src/doc/es/tutorial/conf.py b/src/doc/es/tutorial/conf.py index 913dfc06025..43e23fdc568 100644 --- a/src/doc/es/tutorial/conf.py +++ b/src/doc/es/tutorial/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/es/tutorial', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/es/tutorial', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/es/tutorial', '{filename}'), }) # General information about the project. diff --git a/src/doc/fr/a_tour_of_sage/conf.py b/src/doc/fr/a_tour_of_sage/conf.py index 19c047882bf..af1f453f3e4 100644 --- a/src/doc/fr/a_tour_of_sage/conf.py +++ b/src/doc/fr/a_tour_of_sage/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/fr/a_tour_of_sage', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/fr/a_tour_of_sage', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/fr/a_tour_of_sage', '{filename}'), }) # General information about the project. diff --git a/src/doc/fr/tutorial/conf.py b/src/doc/fr/tutorial/conf.py index 87c13353111..af70d3eb4ff 100644 --- a/src/doc/fr/tutorial/conf.py +++ b/src/doc/fr/tutorial/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/fr/tutorial', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/fr/tutorial', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/fr/tutorial', '{filename}'), }) # General information about the project. diff --git a/src/doc/hu/a_tour_of_sage/conf.py b/src/doc/hu/a_tour_of_sage/conf.py index 590be9195cb..b097f56dfe0 100644 --- a/src/doc/hu/a_tour_of_sage/conf.py +++ b/src/doc/hu/a_tour_of_sage/conf.py @@ -22,9 +22,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/hu/a_tour_of_sage', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/hu/a_tour_of_sage', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/hu/a_tour_of_sage', '{filename}'), }) # General information about the project. diff --git a/src/doc/it/a_tour_of_sage/conf.py b/src/doc/it/a_tour_of_sage/conf.py index 6d217dee7ec..d06280ece36 100644 --- a/src/doc/it/a_tour_of_sage/conf.py +++ b/src/doc/it/a_tour_of_sage/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/it/a_tour_of_sage', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/it/a_tour_of_sage', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/it/a_tour_of_sage', '{filename}'), }) # General information about the project. diff --git a/src/doc/it/faq/conf.py b/src/doc/it/faq/conf.py index c2cd668d0f8..e3898184a1f 100644 --- a/src/doc/it/faq/conf.py +++ b/src/doc/it/faq/conf.py @@ -22,9 +22,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/it/faq', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/it/faq', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/it/faq', '{filename}'), }) # General information about the project. diff --git a/src/doc/it/tutorial/conf.py b/src/doc/it/tutorial/conf.py index 13bfa100034..15186edb4ba 100644 --- a/src/doc/it/tutorial/conf.py +++ b/src/doc/it/tutorial/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/it/tutorial', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/it/tutorial', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/it/tutorial', '{filename}'), }) # General information about the project. diff --git a/src/doc/ja/a_tour_of_sage/conf.py b/src/doc/ja/a_tour_of_sage/conf.py index 105cae0a93d..e8ec7cca39b 100644 --- a/src/doc/ja/a_tour_of_sage/conf.py +++ b/src/doc/ja/a_tour_of_sage/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/ja/a_tour_of_sage', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/ja/a_tour_of_sage', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/ja/a_tour_of_sage', '{filename}'), }) # General information about the project. diff --git a/src/doc/ja/tutorial/conf.py b/src/doc/ja/tutorial/conf.py index ef32faab6b8..9002593de99 100644 --- a/src/doc/ja/tutorial/conf.py +++ b/src/doc/ja/tutorial/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/ja/tutorial', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/ja/tutorial', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/ja/tutorial', '{filename}'), }) # General information about the project. diff --git a/src/doc/pt/a_tour_of_sage/conf.py b/src/doc/pt/a_tour_of_sage/conf.py index 075e2d7a4f5..267d499ca64 100644 --- a/src/doc/pt/a_tour_of_sage/conf.py +++ b/src/doc/pt/a_tour_of_sage/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/pt/a_tour_of_sage', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/pt/a_tour_of_sage', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/pt/a_tour_of_sage', '{filename}'), }) # General information about the project. diff --git a/src/doc/pt/tutorial/conf.py b/src/doc/pt/tutorial/conf.py index 13582d8b896..a5cabc5b0d1 100644 --- a/src/doc/pt/tutorial/conf.py +++ b/src/doc/pt/tutorial/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/pt/tutorial', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/pt/tutorial', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/pt/tutorial', '{filename}'), }) # General information about the project. diff --git a/src/doc/ru/tutorial/conf.py b/src/doc/ru/tutorial/conf.py index 5ff38a94d50..5d39f7d2600 100644 --- a/src/doc/ru/tutorial/conf.py +++ b/src/doc/ru/tutorial/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, 'blob/develop/src/doc/ru/tutorial', '{filename}'), + 'source_view_link': os.path.join(source_repository, 'blob/develop/src/doc/ru/tutorial', '{filename}'), + 'source_edit_link': os.path.join(source_repository, 'edit/develop/src/doc/ru/tutorial', '{filename}'), }) # General information about the project. diff --git a/src/doc/tr/a_tour_of_sage/conf.py b/src/doc/tr/a_tour_of_sage/conf.py index c1854ee2f42..b7536470bd4 100644 --- a/src/doc/tr/a_tour_of_sage/conf.py +++ b/src/doc/tr/a_tour_of_sage/conf.py @@ -20,9 +20,10 @@ # contains common paths. html_static_path = [] + html_common_static_path -# Add a small edit button. +# Add small view/edit buttons. html_theme_options.update({ - 'source_edit_link': os.path.join(source_repository, f'blob/develop/src/doc/tr/a_tour_of_sage', '{filename}'), + 'source_view_link': os.path.join(source_repository, f'blob/develop/src/doc/tr/a_tour_of_sage', '{filename}'), + 'source_edit_link': os.path.join(source_repository, f'edit/develop/src/doc/tr/a_tour_of_sage', '{filename}'), }) # General information about the project. diff --git a/src/sage_docbuild/conf.py b/src/sage_docbuild/conf.py index 50d56ccfd05..c351955497c 100644 --- a/src/sage_docbuild/conf.py +++ b/src/sage_docbuild/conf.py @@ -694,8 +694,8 @@ def add_page_context(app, pagename, templatename, context, doctree): context['reference_root'] = os.path.join(relpath, 'index.html') context['refsub'] = True if pagename.startswith('sage/'): - # This is for adding small edit button using Furo's feature: - # https://pradyunsg.me/furo/customisation/edit-button/#adding-an-edit-button + # This is for adding small view/edit buttons using Furo's feature: + # https://pradyunsg.me/furo/customisation/top-of-page-buttons/ # This works well if the source file is '.rst' file. But the '.rst' # files in the directory 'sage/' are generated by the Sphinx # autodoc from the Python or Cython source files. Hence we tweak @@ -703,7 +703,8 @@ def add_page_context(app, pagename, templatename, context, doctree): # source files are generated. suffix = '.py' if importlib.import_module(pagename.replace('/','.')).__file__.endswith('.py') else '.pyx' context['page_source_suffix'] = suffix - context['theme_source_edit_link'] = os.path.join(source_repository, f'blob/develop/src', '{filename}') + context['theme_source_view_link'] = os.path.join(source_repository, f'blob/develop/src', '{filename}') + context['theme_source_edit_link'] = os.path.join(source_repository, f'edit/develop/src', '{filename}') dangling_debug = False