Skip to content

Conversation

anuraaga
Copy link

@anuraaga anuraaga commented Aug 15, 2025

Summary

Migrates API docs from autodoc to mkdocstrings. I was hoping to be able to use an httpx inventory file in some documentation and noticed there seems to be interest in it from the attached issue so tried sending a PR.

I have made tweaks such as to the CSS to make it as close to the current site as possible. Though it could also make sense to have the full TOC.

The biggest difference in rendering is the docs don't have a inlet and are rendered directly. There are some other differences like font size and not showing the word class (mkdocstrings may allow it in the future as they have an insiders-only feature for it right now).

I did leave the source code previews since while very different from current, being collapsed they seemed safe to keep.

To really render using mkdocstrings, i.e. rendering out parameters in a structured way, the docstrings themselves would need to be updated to one of the supported styles like Google, numpy, or sphinx. This PR doesn't change that though to be smaller and still be quite close to what's already there, while also providing the inventory file.

To test, I run

uv run --with mkdocs --with mkdocs-material --with mkautodoc --with 'mkdocstrings[python]' mkdocs build
open site/index.html

Fixes #3145

image
 uvx sphobjinv suggest site/objects.inv as_rst

-------------------------------------------------------------------------------------------

Cannot infer intersphinx_mapping from a local objects.inv.

-------------------------------------------------------------------------------------------

Project: HTTPX
Version: 0.0.0

164 objects in inventory.

-------------------------------------------------------------------------------------------

No results found with score at/above current threshold of 75.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@anuraaga
Copy link
Author

@lovelydinosaur Any interest in this? If not will go ahead and close this. Thanks.

@pollier
Copy link

pollier commented Sep 21, 2025

Hello, it would be great to be able to use objects.inv, generated by mkdocstring to have auto cross reference in project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cross reference documentation with mkdocstrings' objects.inv

2 participants