diff --git a/docs/generating_stardoc.md b/docs/generating_stardoc.md index 88a37bd5..33e4c5aa 100644 --- a/docs/generating_stardoc.md +++ b/docs/generating_stardoc.md @@ -133,14 +133,18 @@ like documentation to be generated. For example, you may want to generate documentation for `foo_rule`, `bar_rule`, and `baz_rule`, all in different `.bzl` files. First, you would create a single `.bzl` file -which loads these files: +which loads these files and binds the rules to be documented as globals: `doc_hub.bzl`: ```python -load("//foo:foo.bzl", "foo_rule") -load("//bar:bar.bzl", "bar_rule") -load("//baz:baz.bzl", "baz_rule") +load("//foo:foo.bzl", _foo_rule = "foo_rule") +load("//bar:bar.bzl", _bar_rule = "bar_rule") +load("//baz:baz.bzl", _baz_rule = "baz_rule") + +foo_rule = _foo_rule +bar_rule = _bar_rule +baz_rule = _baz_rule # No need for any implementation here. The rules need only be loaded. ```