Closed stuhood closed 2 years ago
Did you have a "smart" way (some sort of linking/labeling system that the docs tool has?) or were you just looking for a "Required Backend" heading and a link to the corresponding backend?
I think the latter, adding something like Required backend: pants.backend.python.lint.bandit
here:
I submitted a suggested edit to that bandit page, but I have no idea where to track it :/
Thanks! I like the formatting you proposed:
Unfortunately, that part of the docs is autogenerated, so it would be overwritten next time they get generated. But that's a good example of what we can aim for.
Would you have an interest in helping with the implementation? If so, we'd be really happy to write up some instructions! The first step would be starting to track which backend something comes from when subsystems and targets are registered - happy to write up some thoughts on how to do that.
Ok, got it. Yeah, I'd like to try and contribute to whatever is a good first step. Some pointers would be great!
https://github.com/pantsbuild/pants/pull/12623 provides the necessary data. Once that's merged, we can look at how to use the data in the reference page generation process.
@williamscs https://github.com/pantsbuild/pants/pull/12623 is now merged, and provides the data structures with the necessary data. If you'd like to take a whack at actually applying the data to the generated reference pages, we're happy to provide pointers!
The main file of interest is https://github.com/pantsbuild/pants/blob/main/src/python/pants/help/help_info_extracter.py , which extracts data into an AllHelpInfo
class . We'd want to augment that class with this new data.
Then, it's pretty easy to find the parts of the codebase that use AllHelpInfo
to generate reference pages, as well as terminal help text.
Labeling subsystems with their backends would make it clearer which backends needed to be enabled in order to activate certain features. It would also make it safe(r) to render experimental backends on the docsite.
Relates to #8992.