uharfbuzz icon indicating copy to clipboard operation
uharfbuzz copied to clipboard

Add API reference generated by Sphinx

Open Hoolean opened this issue 1 year ago • 2 comments

Hello - I've had a stab at #206!

This is largely a modification of sphinx-quickstart to automatically generate an API reference for the module, taking a few hints from fonttools/ufoLib2 to inform structure, build workflow, and styling.

It can be tested as follows:

tox -e docs

...and seems to be fairly happy with Cython, aside from a known upstream issue with displaying the types of properties (sphinx-doc/sphinx#7448).

In general, the generated documentation will remain sparse until more docstrings are added, however, it will hopefully still deliver an improvement over reading the sources, especially with the built-in search functionality that Sphinx provides :)

Known caveats:

  • Author and derived copyright are lifted from setup.py; are these the most accurate to use?
  • No CI integration

Note: this is a personal contribution independent of my employer, and so I've submitted from a fork under my personal profile and email to make this distinction :heavy_check_mark:

Hoolean avatar Sep 22 '24 11:09 Hoolean

Thanks for the speedy review Khaled :muscle: I'll see what it would take to run the tox command alongside the project tests, and/or construct a basic .readthedocs.yml

Hoolean avatar Sep 24 '24 21:09 Hoolean

I've added a template .readthedocs.yml, and have tried to use options cautiously until we are able to test in a real environment; in particular, I am not sure how the doc's dependency on a compiled wheel will be handled.

Would someone with maintainer access be willing to follow the Read the Docs procedure required to create a sub-domain and have it insert actions into this repository to populate the docs?

Side note: if the pull request option is available for community plans then we may be able to avoid the duplicate runner effort of including a CI job for docs on GitHub too :rocket:

Hoolean avatar Sep 24 '24 21:09 Hoolean

I’m merging this now to see how building on read the docs goes, and we can do any amendments/fixes in another PR.

khaledhosny avatar Nov 05 '24 14:11 khaledhosny

Side note: if the pull request option is available for community plans then we may be able to avoid the duplicate runner effort of including a CI job for docs on GitHub too

I enabled it, I don’t know if it works or not.

khaledhosny avatar Nov 05 '24 14:11 khaledhosny

I did a few small tweaks and it seems the docs now build https://uharfbuzz.readthedocs.io, time to actually start documenting the code 😄

khaledhosny avatar Nov 05 '24 16:11 khaledhosny