Skip to content

Commit

Permalink
Update multiple files example (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyduquettesc authored Mar 23, 2022
1 parent 4d5b5da commit 383aa76
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/generating_stardoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
```
Expand Down

0 comments on commit 383aa76

Please sign in to comment.