Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves: #462
here is a screenshot of the built docs page built from drivers.rst with the new import names added:
Note that some lines already had something else in parenthesis so now there are two parenthesized items for them.
I did attempt the other style with the
code
syntax, but as far as I can tell this doesn't seem to be possible within a toctree definition for sphinx. I tried a few different ways to format it, but all of them caused the link to get broken and show the full URL and angle brackets on the page. The only docs I could find are here: https://sphinx-doc-zh.readthedocs.io/en/latest/markup/toctree.htmlIt doesn't have much specific info about the required syntax used but mentions that it's "similar to rst links"
The shortnames used are "naively" constructed by prepending "adafruit_" to the short name found in the docs URL. The two libraries that I changed manually were
neopixel
andneopixel_spi
which don't have the leadingadafruit_
. I'm not aware of any other libraries that are like that, but if there are any they will be wrong in this file currently.I've also checked in the script used to generate these changes, I'm not sure if we would want to keep it or not. It assumes the old format of drivers.rst and has no logic to prevent adding more copies of the import name so if drivers.rst is updated then this script wouldn't really useful beyond historical context without further changes.
This script is meant to run as a "one shot" and I've committed the results here. Moving forward PRs would need to include this import name with the line that they commit into drivers.rst. Perhaps it could be automated with actions, but I didn't pursue that avenue, if it's something we'd like to do I could look into it.