-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBUILD.bazel
59 lines (48 loc) · 1.27 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
load(
"//bazeldoc:defs.bzl",
"doc_for_provs",
"write_header",
doc_providers = "providers",
)
load("//bzlformat:defs.bzl", "bzlformat_pkg")
bzlformat_pkg(name = "bzlformat")
filegroup(
name = "doc_files",
srcs = glob(["*.md"]) + [
# A doc file has a reference to this file.
"BUILD.bazel",
],
visibility = ["//:markdown_test_visibility"],
)
# MARK: - Documentation Providers
_STARDOC_INPUT = "//bzlformat:defs.bzl"
_DOC_DEPS = ["//bzlformat:defs"]
_RULES_AND_MACROS_DOC_PROVIDER = doc_providers.create(
name = "rules_and_macros_overview",
stardoc_input = _STARDOC_INPUT,
symbols = [
"bzlformat_format",
"bzlformat_pkg",
"bzlformat_missing_pkgs",
"bzlformat_lint_test",
],
deps = _DOC_DEPS,
)
_ALL_DOC_PROVIDERS = [
_RULES_AND_MACROS_DOC_PROVIDER,
]
# MARK: - Headers
write_header(
name = _RULES_AND_MACROS_DOC_PROVIDER.header_label,
header_content = [
"# Rules and Macros",
"",
"The rules and macros described below are used to format, test and ",
"copy Starlark source files.",
],
symbols = _RULES_AND_MACROS_DOC_PROVIDER.symbols,
)
# MARK: - Generate Documentation from Providers
doc_for_provs(
doc_provs = _ALL_DOC_PROVIDERS,
)