KEMBAR78
Make use of Sphinx inventories for cross references by Viicos · Pull Request #8682 · pydantic/pydantic · GitHub
Skip to content

Conversation

@Viicos
Copy link
Member

@Viicos Viicos commented Jan 30, 2024

Fixes #8664

This is far from complete but can give you an overview.

types:

### `datetime.datetime`
### [`datetime.datetime`][]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure you'd want references directly on the headings. If so, I can remove them

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♀️ I think it'd be nice! Looks good.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking - have you built the docs locally to confirm that the [datetime.datetime][] style of references correctly redirects to the stdlib python docs?

Copy link
Contributor

@pawamoy pawamoy Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These manual references will produce warnings if they can't be resolved, failing MkDocs builds in strict mode, so the checking is kinda automated 🙂

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 30, 2024

CodSpeed Performance Report

Merging #8682 will not alter performance

Comparing Viicos:sphinx-inv-refs (653fad7) with main (0404872)

Summary

✅ 10 untouched benchmarks

Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far! Thanks for your work on this 🚀 .

filters: ["!^_"]
docstring_options:
ignore_init_summary: true
merge_init_into_class: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be nice to add these too:

parameter_headings: true
show_signature_annotations: true
signature_crossrefs: true

Copy link
Contributor

@pawamoy pawamoy Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For parameter headings, you'll have to install the Insiders version of mkdocstrings-python, similar to how you install mkdocs-material:

pdm run python -m pip install https://files.scolvin.com/${MKDOCS_TOKEN}/mkdocs_material-9.4.2+insiders.4.42.0-py3-none-any.whl

https://mkdocstrings.github.io/python/insiders/installation/

Let me know if any other user (Pydantic team member or bot) needs to be added to the @pawamoy-insiders organization 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added:

show_signature_annotations: true
signature_crossrefs: true

types:

### `datetime.datetime`
### [`datetime.datetime`][]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♀️ I think it'd be nice! Looks good.

@sydney-runkle
Copy link
Contributor

@Viicos,

Do you want to continue to make progress on this PR, or do this in chunks?

@Viicos
Copy link
Member Author

Viicos commented Feb 13, 2024

Maybe better in chunks, merging this will allow other PRs to make use of this feature

Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, tysm!

@sydney-runkle sydney-runkle merged commit 14ce997 into pydantic:main Feb 13, 2024
@Viicos Viicos deleted the sphinx-inv-refs branch February 13, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Sphinx inventory references in docs

3 participants