-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Docs: a start on an 'improve this page' feature #136246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
673e347
2daceae
3a768df
32e27f6
7cc87b3
e536574
d2c895c
5313650
4e4d9b3
2171f71
6472b68
722fb00
c64723b
a8d8a6e
85dc4b4
a6a0537
9ccbd62
280d274
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| :orphan: | ||
|
|
||
| **************************** | ||
| Improve a documentation page | ||
| **************************** | ||
|
|
||
| .. 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 <TRANSLATION_REPO_>`_ 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 <https://discuss.python.org/new-topic?category=documentation>`_. | ||
|
|
||
| - 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 <https://github.com/python/cpython/issues/new?labels=docs>`_. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||
| :orphan: | ||||||
|
|
||||||
| **************************** | ||||||
| Improve a documentation page | ||||||
| **************************** | ||||||
|
|
||||||
| .. only:: html and not epub | ||||||
|
|
||||||
| .. raw:: html | ||||||
|
|
||||||
| <script> | ||||||
| document.addEventListener('DOMContentLoaded', () => { | ||||||
| const params = new URLSearchParams(window.location.search); | ||||||
| document.body.innerHTML = document.body.innerHTML | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is vulnerable to a DOM based XSS, no? We should escape the params.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excellent point, and I should have known better. I will fix it.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
| .replace(/PAGETITLE/g, params.get('pagetitle')) | ||||||
| .replace(/PAGEURL/g, params.get('pageurl')) | ||||||
| .replace(/PAGESOURCE/g, params.get('pagesource')); | ||||||
| }); | ||||||
| </script> | ||||||
|
|
||||||
| We are always interested to hear ideas about improvements to the documentation. | ||||||
|
|
||||||
| You were reading "PAGETITLE" at `<PAGEURL>`_. The source for that page is on | ||||||
| `GitHub <https://github.com/python/cpython/blob/main/Doc/PAGESOURCE?plain=1>`_. | ||||||
|
|
||||||
|
nedbat marked this conversation as resolved.
|
||||||
| .. 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 <TRANSLATION_REPO_>`_ 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" <https://discuss.python.org/new-topic?category=documentation&title=Question+about+page+%22PAGETITLE%22&body=About+the+page+at+PAGEURL%3A>`_. | ||||||
|
|
||||||
| - 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" <https://github.com/python/cpython/issues/new?title=Docs%3A+problem+with+page+%22PAGETITLE%22&labels=docs&body=The+page+at+PAGEURL+has+a+problem%3A>`_. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly to above,
Suggested change
I expect this will also require updating body.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The URL works to create the title and body, but does not apply the label, as tested here: #144780. I think this is fine. |
||||||
|
|
||||||
| - You can `edit the page on GitHub <https://github.com/python/cpython/blob/main/Doc/PAGESOURCE?plain=1>`_ | ||||||
| to open a pull request and begin the contribution process. | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this (specifically
labels=docs) link won't work for anyone who doesn’t have triage permissions in CPython (otherwise, spammers could create "triaged" issues), I suggest linking to the template instead, i.e.: https://github.com/python/cpython/issues/new?template=documentation.ymlThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the template is a better choice, I'll change it.