-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
set up documentation using mkdocs #215
Conversation
Recently, one of the issues in the limitations section has been resolved and I have to edit some of the docs. Will submit the updates subsequently to this PR. So, it should be held off as a draft. |
OK let me know once OK ; I've reviewed most of it |
OK. It's ready except for the issue mkdocstrings/griffe#355 I think it might have do to with cython behaviour than mkdocstrings. I followed the hints that the author left in the conversation but I can't seem to get it working with |
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.
Regarding the docstrings not showing properly, I forgot to update the version number of the dependencies after I submitted a PR for Aside from the issue with cython, everything works fine and it's very much complete. If it's ready for merging, I can squash the commits then. |
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 ; that looks quite nice!
I have one last suggestion now.
With your current docstrings, those attributes for which we cant get return types directly appear like this:

If we dont put the type in the leading part of the dosctring but in a Returns section, it looks like this:

There sure is duplication of that return value description but I think it looks more practical. What do you think?
Here's the diff for that example.
diff --git i/libzim/libzim.pyx w/libzim/libzim.pyx
index b5960ea..71ef204 100644
--- i/libzim/libzim.pyx
+++ w/libzim/libzim.pyx
@@ -1149,10 +1149,13 @@ cdef class Archive:
@property
def entry_count(self) -> pyint:
- """int: Number of user entries in Archive.
+ """Number of user entries in Archive.
If Archive doesn't support “user entries”
then this returns `all_entry_count`.
+
+ Returns:
+ (int): Number of user entries in Archive.
"""
return self.c_archive.getEntryCount()
Whether you switch to it or not, you can rebase or squash then and we'll merge.
a6e4e5a
to
1cec98c
Compare
I have duplicated the docstring in the Returns section. Seems like the authors of mkdocstrings forgot to inspect the annotation of the |
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.
👍
It's failing only on aarch64 for Python3.13. Opened #216 |
1cec98c
to
8215fd9
Compare
Rationale
Make API documentation online via readthedocs.com. This resolves #186
Changes
force_inspection
flag being set totrue
.zim.Entry
instead ofzim::Entry
to refer to C++ objects because of formatting issues with docstring style.Limitations
Given the docstrings are defined in
libzim.pyx
files and not in the.pyi
files, documentation was built by setting theforce_inspection
flag ofgriffe
totrue
. This forcesgriffe
(internal tool used by mkdocs) to inspect the compiled module. We merely used the.pyi
files to generate the names of the reference pages. As a consequence, there are a few limitations to be aware of:@property
decorator. (feature: include proper labels when inspecting compiled module mkdocstrings/griffe#354)__init__
level docstrings of base classes and derived ones are omitted (bug: cyclic aliases detected when inspecting compiled modules mkdocstrings/griffe#355). The current hack is to omit the docstrings and to setmerge_init_into_class
tofalse