-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
reST Primer duplicates the Sphinx version; should link to it instead #1000
Comments
This was brought up again at the December docs community meeting, where this seems to be a reasonable step to move forward with. @Mariatta @encukou or anyone (it will have to be one of the few people with write permission on this repo), could you transfer this issue to the devguide repository, as it is more appropriate there? Thanks! |
Thanks @encukou ! Funny enough, it's issue 1000 for the devguide, created within 24 hours of issue 100000 for the CPython repo. python/peps#2337 is the equivalent for PEP 12 in the PEPs repo, for reference. |
Good idea, I sometimes want to find out more info. Occasionally I need to dip into https://docutils.sourceforge.io/docs/user/rst/quickref.html and https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html.
I'm generally fine with some duplication, I find the devguide page very convenient as a one-stop reference guide. In fact, I'm also using it when doing non-CPython docs too. The Sphinx page is good though. |
I agree with @hugovk. I find the devguide page very convenient, since I know where to find it, and I know that (almost) everything I need is in that page. Docutils and Sphinx docs have several pages each and finding what you need is generally more time-consuming.
I would also add https://docutils.sourceforge.io/docs/user/rst/quickref.html. This already has links to the docutils reST specification, like you suggested in:
However it doesn't include some additional Sphinx constructs.
What do you mean exactly? For example the Lists and quotes section includes both examples and explanations. If you just leave the examples it will end up looking like https://docutils.sourceforge.io/docs/user/rst/quickref.html#bullet-lists and we might end up duplicating the quickref instead. If you leave an empty section with just a link to the Sphinx reST primer it will have roughly the same content but will need an extra click. Another option would be to just download the Sphinx reST primer and There might also be some extension that does that automatically without having to download it manually, but I haven't looked. |
Sorry if it was unclear; to clarify, right now I'm specifically focused on the reStructuredText Primer section of the reStructuredText Markup pag, rather than the rest of the page. I have investigated it further, and the TL;DR is that aside from a few minor tweaks, I've confirmed that this specific section is a nearly exact copy of the Sphinx reStructuredText Primer...from before it was initially committed to the Sphinx repository nearly 15 years ago. FULL INVESTIGATION RESULTSI created a branch on my fork containing the four versions as the contents of the
If we compare the first-ever March 2008 Sphinx version against the original devguide version, only a few lines are different, encompassing two trivial wording tweaks due to not being a part of CPython's own documentation and two modest additions. Given that, it seems likely that the devguide copy is from an even older version of the document before it was checked in to the Sphinx repository, as it is missing the additions/clarifications while having no changes of its own. Now comparing that original devguide version against the current version, we only see a small handful of changes in the 11 years since then, and even fewer of them substantive—adding a few ref target labels and a couple ref links, changing a heading level style, updating a URL, and a couple small wording clarifications. By contrast, comparing the original Sphinx version against the current one, we can see there has been substantial updates, clarifications improvements and additions over the same time period, including incorporating or superseding all but a couple of those above. Taking the results and feedback above into account, my revised proposal is to:
|
My further investigation has confirmed for the reST primer, the entire section is essentially a duplicate of the Sphinx version from ≈15 years ago, with a few minor tweaks since. The fact that people are still relying on it for other docs, rather than the updated, improved and extended official version, seems a little unfortunate and is IMO a good reason to point users to the canonical version instead of keeping around a 1 1/2 decade old copy.
To note, the revised proposal eliminates that part and just links to the Sphinx version of the primer directly, which has abundant links to the reST spec throughout and also links it and the old docutils primer and quickref (which the Sphinx primer supercedes both of) at the top.
Hmm, well this would make what is by far the longest page on the devguide even longer and would deny a clear separation between the general reST/Sphinx content and the sections focused specifically on CPython. It would also need to be investigated from a licensing perspective, as it would mean this repo is no longer cleanly licensed PSF-2.0 and fully covered by the CLA. And of course, it would also add non-trivial complexity, fragility and maintenance issues, as we'd need to:
Ultimately, I'm having trouble understanding the justification for all this—I'm not aware of where else in the devguide, CPython docs or elsewhere where we straight copied a whole page of the existing documentation of an external language or tool (e.g. C/++, GCC/Clang, MSVC, GDB, etc) into ours rather than just discussing CPython-specific guidance and linking to an appropriate canonical resource for the rest. The closest I can see is the Git cheatsheet, but even then the content there is focused specifically on using Git in the context of CPython (as the rest of the docs content is here), as opposed to being copied from the Git manual. I guess I'm just not understanding what is so special about this particular case that justifies this approach? |
It's just a matter of convenience/habit, since some of us visit this page semi-regularly. If this page didn't exist in the first place, we would have just gotten used to the Sphinx primer instead. The points you raised are valid though, so I guess we can handle an extra click and/or update our habits :) If we still end up finding it inconvenient, we can always update the quick reference or add more sections/links. |
Similar to PEP 12, the reST primer in the devguide duplicates the same information in the Sphinx reST primer, along with some bits specific to its particular context.
In fact, unlike PEP 12, they are mostly word for word identical and thus clearly derive from a common source, with the Sphinx version being close to a strict superset of the CPython version, containing some additional and updated sections but also still mentioning many CPython-specific conventions (e.g. section heading format).
This near-duplication is clearly not very DRY, and has several main problems:
Therefore, I propose for the Devguide reST primer:
There are also some non-specific bits that could be trimmed from the
Additional Markup Constructs
section, and each role/directive should be linked to its canonical full Sphinx documentation if present, but that can be addressed separately on a case by case basis.If we agree this is desirable, I'm willing to take this on, unless @ezio-melotti would prefer to do it.
Somewhat related: #916
The text was updated successfully, but these errors were encountered: