Skip to content
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

Add api docs #16

Merged
merged 7 commits into from
Oct 6, 2024
Merged

Add api docs #16

merged 7 commits into from
Oct 6, 2024

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 5, 2024

What do these changes do?

Add API docs

Are there changes in behavior for the user?

no

@bdraco bdraco marked this pull request as ready for review October 6, 2024 00:04
@webknjaz
Copy link
Member

webknjaz commented Oct 6, 2024

@bdraco would you want to integrate sphinxcontrib.apidoc instead of authoring these in separate documents? Here's a configuration example: https://github.com/ansible/awx_plugins.interfaces/blob/devel/docs/conf.py#L126-L138. You basically add a dep, add it to the extensions, make a gitignored folder and include that in the index file. And it builds the pages from docstrings.

docs/api.rst Outdated Show resolved Hide resolved
docs/index.rst Outdated Show resolved Hide resolved
@webknjaz
Copy link
Member

webknjaz commented Oct 6, 2024

Oh.. That might be problematic for the C-extensions, though.

bdraco and others added 2 commits October 5, 2024 19:15
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
@bdraco
Copy link
Member Author

bdraco commented Oct 6, 2024

@bdraco would you want to integrate sphinxcontrib.apidoc instead of authoring these in separate documents? Here's a configuration example: ansible/awx_plugins.interfaces@devel/docs/conf.py#L126-L138. You basically add a dep, add it to the extensions, make a gitignored folder and include that in the index file. And it builds the pages from docstrings.

Oh.. That might be problematic for the C-extensions, though.

I think that makes sense if we end up adding more here. I'm not really expecting this module will be all that active though.

@bdraco bdraco closed this Oct 6, 2024
@bdraco bdraco reopened this Oct 6, 2024
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 6, 2024
@webknjaz webknjaz enabled auto-merge (squash) October 6, 2024 00:32
@webknjaz webknjaz merged commit bcc9494 into master Oct 6, 2024
83 of 84 checks passed
@webknjaz
Copy link
Member

webknjaz commented Oct 6, 2024

@bdraco I've enabled the PR builds in RTD, apparently, that checkbox wasn't selected.

@Dreamsorcerer
Copy link
Member

@bdraco would you want to integrate sphinxcontrib.apidoc instead of authoring these in separate documents? Here's a configuration example: https://github.com/ansible/awx_plugins.interfaces/blob/devel/docs/conf.py#L126-L138. You basically add a dep, add it to the extensions, make a gitignored folder and include that in the index file. And it builds the pages from docstrings.

I've been meaning to ask if there was a reason we've not done that in any of our projects. We often seem to end up with docs getting a little out-of-sync because they're written manually.

@bdraco
Copy link
Member Author

bdraco commented Oct 6, 2024

I think yarl is a great place to start with this approach as it has a lot of methods and it’s likely to be a lot more active than this lib

@bdraco bdraco deleted the api_docs branch October 6, 2024 13:50
@webknjaz
Copy link
Member

webknjaz commented Oct 7, 2024

@bdraco would you want to integrate sphinxcontrib.apidoc instead of authoring these in separate documents? Here's a configuration example: ansible/awx_plugins.interfaces@devel/docs/conf.py#L126-L138. You basically add a dep, add it to the extensions, make a gitignored folder and include that in the index file. And it builds the pages from docstrings.

I've been meaning to ask if there was a reason we've not done that in any of our projects. We often seem to end up with docs getting a little out-of-sync because they're written manually.

@Dreamsorcerer yeah, I've looked into it a couple of times in the past actually, just forgot :)
The main problem is that the C-extensions aren't inspectable by Sphinx IIRC (there was an upstream bug somewhere). I don't remember if this can be addressed with some stubs like pyi.
Another issue was that Andrew didn't want the docstrings to be big (but I think we last talked about that over 7 years ago). He was also concervative when I brought up the suggestion to auto-include parts README (and other docs that render on GH too) into Sphinx docs to avoid duplication, like I do in all my other projects. I've since seen some mentions that some projects (CPython maybe?) were migrating away from in-docstring docs because it was hurting the readabiliy. But personally, I'm very much in favor of automating stuff.

@webknjaz
Copy link
Member

webknjaz commented Oct 7, 2024

I think yarl is a great place to start with this approach as it has a lot of methods and it’s likely to be a lot more active than this lib

On the contrary, I'd start with a low-traffic lib where experiments could happen in a safe setting, before scaling to places that would require more integration work that might not pay off because of some limitations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants