disnake
disnake copied to clipboard
refactor: improve sphinx extensions
trafficstars
Summary
Adds annotations to all custom sphinx extensions, and reworks the custom html builder defined in docs/extensions/builder.py, replacing outdated or otherwise unnecessarily complex code.
The resulting html is exactly the same as before (both locally and on rtd), except for two things:
- The old dropdown svg isn't used anymore and was removed, the
disnake.svgicon now lives in_staticinstead of_images - The
CustomHTML5TranslatorMixin(which allows horizontally scrolling tables) now applies to the htmlzip build as well
Checklist
- [x] If code changes were made, then they have been tested
- [ ] I have updated the documentation to reflect the changes
- [x] I have formatted the code properly by running
task lint - [x] I have type-checked the code by running
task pyright
- [x] This PR fixes an issue
- [ ] This PR adds something new (e.g. new method or parameters)
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is not a code change (e.g. documentation, README, ...)