-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Make an API online documentation #186
Comments
@kelson42 , I would like to work on this. I don't have much experience with building the docs with readthedocs.com but I am aware you could either use Sphinx or MkDocs as the documentation generators. Do you have any generator in mind? I reckon I could get it done in a week or less if it is assigned to me. |
We need something similar to https://github.com/openzim/python-scraperlib/, which is based on mkdocs. For this repo, most of the work was done with openzim/python-scraperlib#215 and openzim/python-scraperlib#225, and openzim/python-scraperlib@22ddefd Note that this repo is only a very thin wrapper on top of the libzim, so the purpose is mainly to expose / document all available API(s), and explain this fact (that it's a thin wrapper ...). Your work will mostly consist in setting up everything in this repo, I've just setup everything needed on readthedocs.org side. |
Okay. I will work on it. |
I have set up something that works locally. However, there are a few hiccups and I would like to know how best to proceed. On the other hand, it generates the docs for the Obviously, adding the docstring in all the So, should I stick to just working with the bare enumeration (no docstrings) of the class, method and attribute names that the .pyi files expose? Or should I explore the path of extracting the docstring from the compiled |
If possible, I'd like to see how it works via the compiled lib ; just so we have all the information at hand to decide. |
I finally set it up to work with the compiled lib but it's not quite informative.
I tried to use their internal tool griffe to inspect the module and see it's AST tree and it shows a tree which contains just those two attributes. I don't really know much about all the options involved with using setup.py (perhaps to add more data to the compiled binary) and it might take longer to figure out. |
Thanks ; I'd like to take a quick look myself before we decide to move the dosctrings to |
OK, I've looked at it and I think we can make it work I couldn't make it work properly though and had to hack the Python handler. The thing is that ❯ griffe -x libzim The problem being that Here's my fix (toggling it on a new option): *** mkdocstrings_handlers/python/handler.py.orig 2025-01-22 07:53:13
--- mkdocstrings_handlers/python/handler.py 2025-01-22 07:53:18
*************** class PythonHandler(BaseHandler):
*** 318,323 ****
--- 318,324 ----
modules_collection=self._modules_collection,
lines_collection=self._lines_collection,
allow_inspection=final_config["allow_inspection"],
+ force_inspection=final_config["force_inspection"],
)
try:
for pre_loaded_module in final_config.get("preload_modules") or []: There are ways to extend and customize with extension, plugins, etc but I find the reasonable approach is for you to fork Now it's not perfect and I've noted a bunch of other things to fix:
What I did is in the |
Thank you very much @rgaudin |
I have submitted a PR (mkdocstrings/python#231) and it's resolving another issue they had in their repository :). |
Already merged! Awesome! |
I have implemented almost all of this except for a few hiccups. The first is that The second is that the mkdocs fails whenever I write docstrings for I think all of these are consequences of inspecting a compiled module and the library probably does not handle it properly. Aside from these two, everything is done. |
OK good ; I remember there's a Should you maybe start a PR with a checklist of what works and what doesn't ; with corresponding tickets (here or upstream) ? We can maybe use a progressive approach |
The I think starting a PR with a checklist of what works is the best way to proceed and then work off these issues one at a time. I would need to experiment with griffe and be sure I have a better understanding of the internals before filing a ticket on their repo too. |
via readthedocs.com
The text was updated successfully, but these errors were encountered: