From ec706d60530ac2f0caddc6a539ca627e085a79d9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 18 Feb 2026 04:58:30 -0500 Subject: [PATCH] [3.14] Docs: an "improve this page" feature (GH-144939) * Docs: a start on an 'improve this page' feature * pr feedback: simplify the link, and don't scare people with the cla * pr feedback answered - use the actual page URL - tighten the wording * fix the improve link on the improve page * news item * Update Doc/improve-page.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> * fix whitespace * A nojs version of the page * comments to help people keep the two pages in sync * protect against XSS * use template for issues from the nojs page * use the template from the JS page as well * give the docs issue template a fillable description field * ugh, getting sloppy * remove more sloppiness --------- (cherry picked from commit 7a7521bcfad4a8346d460476de2e3fa11e412477) Co-authored-by: Ned Batchelder Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- Doc/improve-page-nojs.rst | 29 +++++++++ Doc/improve-page.rst | 65 +++++++++++++++++++ Doc/tools/templates/customsourcelink.html | 17 ++++- ...-08-02-18-59-01.gh-issue-136246.RIK7nE.rst | 3 + 4 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 Doc/improve-page-nojs.rst create mode 100644 Doc/improve-page.rst create mode 100644 Misc/NEWS.d/next/Documentation/2025-08-02-18-59-01.gh-issue-136246.RIK7nE.rst diff --git a/Doc/improve-page-nojs.rst b/Doc/improve-page-nojs.rst new file mode 100644 index 00000000000000..91b3a88b95d38b --- /dev/null +++ b/Doc/improve-page-nojs.rst @@ -0,0 +1,29 @@ +:orphan: + +**************************** +Improve a documentation page +**************************** + +.. This is the no-javascript version of this page. The one most people + will see (with JavaScript enabled) is improve-page.rst. If you edit + this page, please also edit that one, and vice versa. + +.. only:: html and not epub + +We are always interested to hear ideas about improvements to the documentation. + +.. only:: translation + + If the bug or suggested improvement concerns the translation of this + documentation, open an issue or edit the page in + `translation's repository `_ instead. + +You have a few ways to ask questions or suggest changes: + +- You can start a discussion about the page on the Python discussion forum. + This link will start a topic in the Documentation category: + `New Documentation topic `_. + +- You can open an issue on the Python GitHub issue tracker. This link will + create a new issue with the "docs" label: + `New docs issue `_. diff --git a/Doc/improve-page.rst b/Doc/improve-page.rst new file mode 100644 index 00000000000000..dc89fcb22fbb59 --- /dev/null +++ b/Doc/improve-page.rst @@ -0,0 +1,65 @@ +:orphan: + +**************************** +Improve a documentation page +**************************** + +.. This is the JavaScript-enabled version of this page. Another version + (for those with JavaScript disabled) is improve-page-nojs.rst. If you + edit this page, please also edit that one, and vice versa. + +.. only:: html and not epub + + .. raw:: html + + + +We are always interested to hear ideas about improvements to the documentation. + +You were reading "PAGETITLE" at ``_. The source for that page is on +`GitHub `_. + +.. only:: translation + + If the bug or suggested improvement concerns the translation of this + documentation, open an issue or edit the page in + `translation's repository `_ instead. + +You have a few ways to ask questions or suggest changes: + +- You can start a discussion about the page on the Python discussion forum. + This link will start a pre-populated topic: + `Question about page "PAGETITLE" `_. + +- You can open an issue on the Python GitHub issue tracker. This link will + create a new pre-populated issue: + `Docs: problem with page "PAGETITLE" `_. + +- You can `edit the page on GitHub `_ + to open a pull request and begin the contribution process. diff --git a/Doc/tools/templates/customsourcelink.html b/Doc/tools/templates/customsourcelink.html index 0d83ac9f78adb9..8feeed2fee3650 100644 --- a/Doc/tools/templates/customsourcelink.html +++ b/Doc/tools/templates/customsourcelink.html @@ -1,10 +1,25 @@ {%- if show_source and has_source and sourcename %} +

{{ _('This page') }}

  • {% trans %}Report a bug{% endtrans %}
  • +
  • {% trans %}Improve this page{% endtrans %}
  • - {{ _('Show source') }}
  • diff --git a/Misc/NEWS.d/next/Documentation/2025-08-02-18-59-01.gh-issue-136246.RIK7nE.rst b/Misc/NEWS.d/next/Documentation/2025-08-02-18-59-01.gh-issue-136246.RIK7nE.rst new file mode 100644 index 00000000000000..5f83785df13209 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2025-08-02-18-59-01.gh-issue-136246.RIK7nE.rst @@ -0,0 +1,3 @@ +A new "Improve this page" link is available in the left-hand sidebar of the +docs, offering links to create GitHub issues, discussion forum posts, or +pull requests.