Open Arfey opened 5 years ago
I think, it's important to ask this question on the other avenues like the mailing list and the Gitter chat.
Pinned the issue to make it broader visible
I entirely agree that documentation could do with improvement.
I have some criticisms/suggestions, but first it's important to say that in general aiohttp's docs are great - these are just suggestions of ways of making it even better.
Many developers find markdown much more intuitive to use than rst. I know rst has many powerful features but it's also extraordinarily convoluted to do simple things eg. links are
`name <https://www.example.com/>`_
I find this amazingly complex. Even after having written thousands of lines of it, I still have to google or search for an example of things that are trivial in md.
I think lots of people would be more willing to help with the docs if they were written in markdown. However I know python's own docs are written in rst so many of you will be very hostile to moving to md.
I recently migrated pydantic's docs from sphinx (see here) to mkdocs (see here), it took some time but I think the results are much better.
Let's say I want to find the docs on "middleware". Which section are these in? I've no idea, I have to go to google and search from there. I even wrote some of these docs, so imagine how hard it would be to navigate when you're new to aiohttp.
Sphinx encourages you to split docs into "reference" - auto generated from docstrings and free form documentation with a narrative, however I find this to be a very confusing way of structuring documentation.
I think the docs should have a simple intro, then be split into sections based on logical components rather than "quickstart" vs." advanced usage" vs. "reference".
Perhaps since it would be extremely difficult to rewrite all docstrings in markdown (and I don't know of a popular markdown documentation tool that extracts docstrings), we could keep the reference section somehow generated from docstrings, and link to it in the rest of the docs. See https://github.com/mkdocs/mkdocs/issues/20
Therefore I would propose a documentation structure something like:
I'm sure I've missed quite a few things, but a structure roughly like this would (for me) be massively easier to use.
Entirely understandable, but in quite a few places the aiohttp docs aren't written in the best grammar. I'm dyslexic, so not much better, but I could improve some of this. However the best approach would be to find another native english speaker to improve the english.
In short, I would suggest giving serious thought to moving the docs to mkdocs.
.. function:
, :func:
etc) and ability to write own plugin if needed. We do it for documenting async stuff.The article about documentation writing: https://www.divio.com/blog/documentation/
The article about documentation writing: https://www.divio.com/blog/documentation/
Ye, I saw that on HN. It describes exactly what I disagree with - having documentation split into multiple different narratives is very annoying for casual users and regular users alike.
I can just about imagine having narrative and reference or tutorial and explanation; but 4 sections!!? That's just a recipe for confused users and out-of-date documentation.
mkdocs is great but I really love sphinx markup
I can see I'm not going to win on md :-), which I can understand. I think the much more important thing is the structure of the documentation.
This is not the only way to organize docs; Python doesn't use Reference concept but it provides state-of-the-art documentation.
I think python does it right.
I think multiple sections is just an extra cognitive burden and increases the chance documentation becomes out-of-date because you have to remember to update multiple different places.
However if I can't persuade you to move to one source of truth for a feature, could we reduce it to two maximum?
For example: currently if I want info on how to use websockets, it could be split across:
Surely that can't be good? For comparison Starlette has one page https://www.starlette.io/websockets/ with all info on websockets.
Regarding English -- please don't hesitate to prepare PRs with improvements
Life is always too busy, but I'll try.
I don't know how many parts are good. I think the problem of any docs reorganization is that hard to say if the new approach is good before looking at the complete new version.
Let's look at click
docs: several chapters of domain-oriented topics (parameters, options, commands etc) plus a full reference.
What do you think about this style?
After uick look on starlette I would say I miss cross references befween parts (CPython uses them intensively despite the fact that it has no strict usage-reference separation).
I agree link between different docs sections is vital. This is one of the things sphinx/rst does better than mkdocs/md.
I agree the click approach is good, though until today I never new there was a reference section - I just read the domain oriented topics and read the code if that didn't suffice.
Different style of thinking :) I usually read the Reference section to figure out what is a part of official public API and what is a leaked implementation detail (even it doesn't start with the underscore prefix).
Being a quite fresh user of aiohttp server and client, I'd like to add some proposals that I ran into, when studying the (already very supportive!) docs:
Any thoughts about that?
I'd like to augment @samuelcolvin's take on Markdown. I personally like the RST markup but it's understandable that some folks, especially newbies, find it difficult at start.
I know that there's been attempts to integrate Markdown support into Sphinx that had a lot of limitations that thus never became truly popular (recommonmark).
OTOH I've heard that some projects allow contributing new docs in Markdown that may later be converted into RST by more proficient contributors (https://youtu.be/0ROZRNZkPS8?t=502s). I'm leaning towards the opinion that it's a good approach to follow.
But what do we do with the recommonmark limitations? Turns out that at the beginning of 2020 a significant project emerged that allows using RST roles and directives from within Markdown documents. It's called MyST: https://myst-parser.readthedocs.io/. It seems like it's a great tool and it is well-maintained too.
That said, I'd be open to adding this sphinx extension as an extra source parser for *.md
files and seeing how it goes.
Here's a few more resources on the docs writing topic:
Hello everyone 🤚.
We want to improve the documentation of aiohttp. To do this, we need to know what, in your opinion, is not well-described in the current version of the documentation and how to make it better.
If you have any advice or want to help writing the documentation, feel free to reply to this issue 👇.