xref: /aosp_15_r20/external/stardoc/docs/getting_started_stardoc.md (revision b2fa42943c124aa9c7163734493fc7a7559681cf)
1*b2fa4294SXin LiStardoc is a documentation generator for [Bazel](https://bazel.build) build rules
2*b2fa4294SXin Liwritten in [Starlark](https://bazel.build/docs/skylark/index.html).
3*b2fa4294SXin Li
4*b2fa4294SXin LiStardoc provides a Starlark rule (`stardoc`)
5*b2fa4294SXin Lithat can be used to build Markdown documentation for Starlark rules, providers,
6*b2fa4294SXin Liand functions.
7*b2fa4294SXin LiStarlark generates one documentation page per `stardoc` target.
8*b2fa4294SXin Li
9*b2fa4294SXin LiIf you are new to writing build rules for Bazel, please read the Bazel
10*b2fa4294SXin Lidocumentation on [writing
11*b2fa4294SXin Liextensions](https://bazel.build/extending/concepts)
12*b2fa4294SXin Li
13*b2fa4294SXin Li## Setup
14*b2fa4294SXin Li
15*b2fa4294SXin LiEdit your `WORKSPACE` file as shown in the `WORKSPACE` setup section for
16*b2fa4294SXin Li[the current Stardoc release](https://github.com/bazelbuild/stardoc/releases).
17*b2fa4294SXin Li
18*b2fa4294SXin LiThen add
19*b2fa4294SXin Li
20*b2fa4294SXin Li```python
21*b2fa4294SXin Liload("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
22*b2fa4294SXin Li```
23*b2fa4294SXin Li
24*b2fa4294SXin Lito your `BUILD` or .bzl file to start using the `stardoc` rule.
25*b2fa4294SXin Li
26*b2fa4294SXin Li## Next Steps
27*b2fa4294SXin Li
28*b2fa4294SXin LiNow you are ready to document your Starlark rules.
29*b2fa4294SXin Li
30*b2fa4294SXin Li* Learn about the [docstring format](writing_stardoc.md) used to document Starlark rules.
31*b2fa4294SXin Li* Learn about how you can use Stardoc's [build rules](generating_stardoc.md) to generate your
32*b2fa4294SXin Li  documentation in Markdown format.
33*b2fa4294SXin Li
34*b2fa4294SXin Li
35