-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
User documentation of kiwix-serve #586
Conversation
187a71a
to
459e64a
Compare
@veloman-yunkan I wonder if the doc can be put on Readthedocs.io? Or how it should be made readable for people? |
This is the first cut. I didn't document the Also, I didn't include any information from the last column of @rgaudin's table from #498 (comment) . Does it have to be reflected in the documentation? kiwix-serve man page is not (yet) updated by this PR. I think it must be done in the end or as a separate PR. |
@kelson42 Yes, similarly to how it was done for libzim. Do we have a kiwix account with readthedocs? Or @mgautierfr used his own? |
@mgautierfr You are best to answer IMO, I'm not informed about an account for kiwix. |
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.
Thank you @veloman-yunkan 👍
I am concerned by the fact your are using an outdated Sphinx version (3.5.4, approaching 2 years old). Since it was released, major versions 4 and 5 were and now version 6 is in pre-release.
Starting a new documentation project on an old version seems odd.
Additionally, because that version loosely references its Jinja2 dependency, it is not working. Also, the theme you are using must be installed.
So for that version to work, the requirements.txt
file should look like:
Sphinx==3.5.4
sphinx-rtd-theme==1.1.1
Jinja2==3.0.3
Note that it doesn't work on Python3.10 but 3.9 is fine.
Another comment is that the doc
option doesn't seem to be set on CI builds right? I think we should build it to ensure it continues to pass. But maybe you'll build and upload to readthedocs on a dedicated workflow?
As per content now, it looks great. And no, I didn't expect the caching stuff to be included ; that was for my own use.
If I may suggest a wording change: I prefer OPDS API
over New OPDS API
as the other one is already called legacy.
@rgaudin That is not a deliberate choice. Without having any prior experience with |
Ah Ok. Well I've tested with latest stable and it works as well so you can use:
Actually, if you remove the reference to the theme in |
There is no kiwix account. Administration of projects on readthedocs are made through your github account (you can log with them on readthedocs)
readthedocs pull and compile the documentation so we don't have any CI to do on our side. I've just activated the project and create a temporary "hidden" documentation for this branch : https://kiwix-tools.readthedocs.io/en/documentation/ As this doesn't compile for the reason exposed by @rgaudin, this is now a 404 but it will change soon. About the dependencies versions: The pinning of On libkiwix I have fixed this by not pinning |
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.
Great work
About ZIMID
: There is a lot of ZIMID
referencing the term ZIM name
. I think it would be better to rename them to ZIMNAME
.
I wonder if we should document all endpoints publicly. Having a documentation for a endpoint de facto create a contract between the developers and the user that they can use the api. Endpoints like /skin
, /catch/external
and viewer_settings.js
are totally private and user should not use them.
In some extend, /suggest
and /content
are kind of private as they are mainly use by the viewer. We may change what they return without further notice (as we keep the viewer in sync with them).
At least we should explicitly state that no stability is guaranteed for them.
I'm in favor of documenting them (kind of the point of the initial ticket) but clearly mark them private or whichever wording implying it being an exposed endpoint but not a supported API. |
Yes. I think you point the right thing here : an endpoint may not be part of a API. Maybe we can move the private endpoint in a specific page "private endpoints" and move the pulbic api into a dedicated "http public api" page ? [*] We may put comment in the code for us but they are not listed in the generated (html) documentation. |
@rgaudin Thanks! I preferred keeping the RTD theme, because of its multilevel table-of-contents in the sidebar.
@mgautierfr Thank you too! This PR is now live at https://kiwix-tools.readthedocs.io/en/documentation/ |
The concerns related to the public/private endpoint separation have not been addressed. Let's decide which approach we are going to take. |
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.
A badge linking to the doc should be added in the README.md
, like on libzim.
Great, Thanks All ! |
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.
LGTM ; Do we want to settle the public/private in this PR or in a following one?
Here my feedback on this subject. I´m not really confortable with the idea of having two levels (unofficial/official, private/public, ...) of APIs. I'm not principly opposite to it, but it sounds really complicated for what we need and I see potential problems appearing because of this. I would suggest that we open a dedicated ticket (before merging that one) for the end-points we are not sure to put in public documented API. We could then discuss if:
These 3 options seems to me good enough (but maybe the future discussion will show that I'm wrong). |
I don't have a strong opinion on whether we should have unsupported endpoints or not. I can see how it gives us flexibility but I can also see how we could allow ourselves to break API at any version, given we document changes and respect semantic versioning. I do have one on documentation though ; as not documenting all the endpoints (ie. hiding somes) would not solve my use cases. I would definitely prefer documented-yet-marked-unsupported ones. Documenting means being transparent and transparency helps integration and maintenance. Kiwix-serve is critical to a number of our products and other organization ones. Hiding it won't prevent users from using it because they might find it anyway because they need something that's not in the public API… but it will break without notice and generate frustration and will discourage them from giving feedback. |
Some endpoint accepts the ZIM UUID while others accepts the Name (not always the metadata The documentation should be clear about which one(s) is accepted. This is currently not the case. For instance, it states
curl https://library.kiwix.org/raw/ubongo_sw_playlist-mziki-wa-ubongo-kids_2021-06/meta/Title
curl https://library.kiwix.org/catalog/v2/entry/00d73467-0b73-08d8-7577-48e1206b7d18 |
There is still the question of how we document the private endpoints. |
#593 is indeed plan in next release But rebasing + CI working is mandatory. In addition https://kiwix-tools.readthedocs.io/en/latest/?badge=latest is empty, not sure this is normal. |
Yes. PR are not included in "latest". Once merged, it should be ok. |
fe19aed
to
3158029
Compare
This commit introduces an embryo of sphinx-based documentation. The content of documentation in this commit is limited to the command line options of kiwix-serve.
This will enable cross-referencing them.
3158029
to
7c7cd42
Compare
Rebasing (combined with some history clean-up) done. CI is "clean" (Packages workflows won't pass until the |
@mgautierfr Good to merge imo |
Fixes #498.