-
Notifications
You must be signed in to change notification settings - Fork 360
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
RxPY 3.0: Documentation #270
Comments
This is a first commit of ReactiveX#270, to start structuring a documentation. For now it contains empty sections, and references to the existing APIs (observable, observer, subject, and operators).
This is a first commit of #270, to start structuring a documentation. For now it contains empty sections, and references to the existing APIs (observable, observer, subject, and operators).
There are some theme samples are http://www.writethedocs.org/guide/tools/sphinx-themes/ . Read-the-docs is nice. Also the Guzzle theme looks quite nice and clean. As for hosting we should be able to get permission to deploy at e.g. http://reactivex.io/rxpy |
I have several commits ready. Should I push them on feature/rxpy-3.0 or wait until the merge on master is done ? |
Concerning the marble diagrams, initially I wanted to reuse the ones from reactivex.io. However they are not all consistent (there are several graphic styles, depending on the operators). Moreover linking to picture does not allow to see the marble diagram when reading the source code. So I wonder if the following could be possible: Create a sphinx addon that would use a tool to convert text based marble diagram to pictures. This would have several advantages compared to static pictures that are hard to update:
The main issue here is to get this marble renderer. Surprisingly I did not find such a tool. If anybody is aware of an existing tool, I am interested! Otherwise maybe it could be relatively easy to implement one based on matplotlib. I will try some mocks if we want to document marble diagrams this way. |
We might want to merge with master first. It's now being added new features on the feature branch, so it's time to merge. We can still have a period of rapid development before locking down and starting doing PRs for the master branch. It would be interesting to see if it would be possible to use Mermaid flowcharts to generate marble diagrams. They are text based and can be used with Markdown and Sphinx. I haven't tried making marble diagrams, and they won't (currently) render directly on GitHub, but they render e.g on HackMD. But I cannot find a way to render to ascii, so it would not be possible to use inside the code doc. Perhaps plain ascii diagrams are simpler and better. |
This is a first commit of #270, to start structuring a documentation. For now it contains empty sections, and references to the existing APIs (observable, observer, subject, and operators).
Status update: I enabled the Guzzle theme, the outline should be complete. Now I will work on the content of the missing parts. |
I have some questions regarding the convention we should use(or not) for docstrings, especially in examples. It is not that serious but there are actually multiple ways for naming input/output observables: >>> res = ...
>>> obs = ...
>>> merged = ...
>>> rx.merge(obs1, obs2)
>>> rx.merge(xs, ys) Concerning >>> res = ...
>>> op = ... When I have the opportunity to update a docstring, I use |
I played with a marble diagram generator from text and have a first implementation running. It is available here: it is also published on pypi. there is a map example in "examples/map.txt" Do not focus on the visual aspects yet. I am confident that we can easily generate diagrams this way. I think I also found a way to describe higher order observable in an easy way. The tool is based on matplotlib, which allows to generate better marble diagrams than what could be done with mermaid diagrams (in my opinion) generate a png with: dooble --input examples/map.txt --output /tmp/map.png what are the opinions on that ? |
This is great! Now I'm curious to see how a higher order observable would look like. A few comments:
|
I changed the script with an entry point. Tell me if installation works better on windows.
We do not draw the vertical links on the text because this is tedious and would break the ebnf based grammar, but they are generated on the diagram. Keeping in mind that this is for documentation with simple diagrams, the text representation seems still readable to me. |
Yes, it's working perfectly, thank you 👍 . |
Now that the content of the readme is - almost - completely in the documentation, I will strip it. I have two questions on that:
|
I still have some paragraphs to complete, but the overall documentation is in good shape. @dbrattli do you know if there is a way to automatically publish it somewhere on reactivex.io ? With travis we can encrypt credentials so that the CI automatically update the doc and nobody needs access to the credentials. I made something like this on a private gitlab-ci that could be relevant here:
I can work on the travis part if needed, provided that there is a way to publish via tooling. |
Does anyone know why sphinx doesn't crosslink properly? For example: These methods have return type |
About those failing crosslinks -- I just quickly tried what happened if I use the bundled Please note, I'm not proposing to do this necessarily, because it will just create a "dry" package/subpackage index at the upper levels, not the nicely decorated "topical" structure there is now under Still, perhaps it might help in tracking down why the crosslinks don't work currently? To me it seems like kind of a big deal to get those working! |
strange. sphinx-apidoc seems to manually create rst files. So we should have the same results than with sphinx-build. There are old references to this issue here: So it's supposed to work here. I tried adding the parameters set by sphinx-apidoc in the rst, and setting the napoleon "use_param" option without success. |
Hm, never noticed this before: if there are docstrings for both class and RxPY/rx/subjects/asyncsubject.py Lines 13 to 15 in e5fb1dc
RxPY/rx/subjects/asyncsubject.py Lines 18 to 19 in e5fb1dc
But the generated docs only have the first section: So the init function is not actually documented! This behaviour can change this with a single sphinx setting, but I just wanted to check if this might be deliberate (i.e. that we were only supposed to put docstrings in either class or |
Wow nice catch! I think that documenting in both class and constructor makes sense: The class documentation contains information on the class itself, while init is specifically for the constructor. |
closing this issue now that v3 is released. We will iterate on the doc with dedicated issues and PR. |
With v3, an official documentation should be provided. This issue can be used to follow the progress on this topic. The following things must be done
The text was updated successfully, but these errors were encountered: