stardoc icon indicating copy to clipboard operation
stardoc copied to clipboard

Show example load() call for each rule

Open cvrebert opened this issue 4 years ago • 3 comments

Whenever I start using a new Starlark rule, the first step is to load() it in my BUILD file. Therefore it would be handy if the Stardoc output for each rule showed an appropriate load() statement that I could directly copy-paste. That way, users don't have to manually tweak the path to the .bzl file, change the final slash to a colon, etc., which is pure avoidable tedium.

cvrebert avatar Apr 07 '21 19:04 cvrebert

That sounds like a nice feature. It might not be applicable in all environments since the repo might be imported by a different non-standard name in the user's WORKSPACE file, but that use is comparatively rare.

brandjon avatar Jun 10 '21 15:06 brandjon

FWIW I've started adding this feature in https://docs.aspect.dev

alexeagle avatar Jun 10 '21 15:06 alexeagle

Now that we have OriginKey in the protos, this should be fairly easy to implement in the renderer for anyone who is interested

tetromino avatar Apr 22 '24 20:04 tetromino