• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Stardoc is a documentation generator for [Bazel](https://bazel.build) build rules
2written in [Starlark](https://bazel.build/docs/skylark/index.html).
3
4Stardoc provides a Starlark rule (`stardoc`)
5that can be used to build Markdown documentation for Starlark rules, providers,
6and functions.
7Starlark generates one documentation page per `stardoc` target.
8
9If you are new to writing build rules for Bazel, please read the Bazel
10documentation on [writing
11extensions](https://www.bazel.build/docs/skylark/concepts.html)
12
13## Setup
14
15To use Stardoc, add the following to your `WORKSPACE` file:
16
17```python
18load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
19
20git_repository(
21    name = "io_bazel_stardoc",
22    remote = "https://github.com/bazelbuild/stardoc.git",
23    tag = "0.4.0",
24)
25
26load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")
27stardoc_repositories()
28```
29
30The load statement and function call after the `io_bazel_stardoc` repository
31definition ensure that this repository's dependencies are loaded.
32
33## Next Steps
34
35Now you are ready to document your Starlark rules.
36
37* Learn about the [docstring format](writing_stardoc.md) used to document Starlark rules.
38* Learn about how you can use Stardoc's [build rules](generating_stardoc.md) to generate your
39  documentation in Markdown format.
40
41
42