-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Format PYI examples in docs as .pyi-file snippets
#13116
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
Conversation
|
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.
Nice, this looks great!
One concern I have with this update is that syntax highlighting is currently not implemented in MK docs for PYI examples.
Hmm, that is a shame (and might indeed be a blocker here, sadly
7d6529e to
044b3ca
Compare
This was found with experimentation. Hopefully, the lack of highlighting of I tested this by installing locally with Do you know of any other places where Should I draft until the next release of pygments or would you consider pinning to a commit of pygments in the requirements? If so, which requirements file would be best for this, as there appear to be a couple in the docs directory? |
Woah, nice! Thanks so much for figuring out the root cause there and filing a PR to solve it — that's awesome 😃 (It's late here so I'll get to your other questions tomorrow :) |
|
pygments/pygments#2773 has been merged and added to the next release milestone. I am unsure of the schedule of the next release of pygments. |
I saw! I'm currently looking into whether it's feasible for us to pin pygments to a commit on their If we do need to wait, we should pick up the latest release of pygments in CI as soon as it's released. The depdendency comes from |
|
I think pinning to a |
PYI files in docs correctlyPYI examples in docs as .pyi-file snippets

Summary
Now that docs are formatted by the Ruff formatter, #13087. It is also possible to format
pyi-style examples with thepyi-style format fixing #11568.One concern I have with this update is that syntax highlighting is currently not implemented in MK docs for PYI examples. Therefore, we need to decide if it is better that the docs are formatted correctly or if syntax highlighting is more important. If the latter is the case, I can investigate this further and draft this PR for now.
Test Plan
CC @AlexWaygood, I would appreciate it if you could review this PR as you opened the issue that prompted this update. I think it would be useful to sense-check the examples that I updated to PYI, as well as let me know and further examples that would benefit from
pyistyle formatting and I can update as required.