Skip to content

Commit

Permalink
preamble to Starlark rule documentation: mention label
Browse files Browse the repository at this point in the history
Stardoc, as opposed to skydoc, ignores module doc-strings. Therefore,
add at least some basic information to the preamble that is added to
the generated markdown document; as that preamble is shared, we have
to keep the text generic, hence, for the time being, only mention the
label the files can be loaded from.

Fixes bazelbuild#9225.

Change-Id: I6b19cd8b5f68e9726c0a113a261e2064302152c1
PiperOrigin-RevId: 266356428
  • Loading branch information
aehlig authored and copybara-github committed Aug 30, 2019
1 parent 18c0509 commit 902e7e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/build_defs/repo/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ REPO_BZL_FILES = [
deps = [":lib"],
) for name in REPO_BZL_FILES]

[genrule(
name = "preamb_%s_md" % (name,),
srcs = [":preamb.md"],
outs = ["preamb_%s.md" % (name,)],
cmd = "sed 's/BZL_FILE_BASE_NAME/%s/g' < $< > $@" % (name,),
) for name in REPO_BZL_FILES]

[genrule(
name = "%s_md" % (name,),
srcs = [
":preamb.md",
":preamb_%s.md" % (name,),
":%s_raw_md" % (name,),
],
outs = ["%s.md" % (name,)],
Expand Down
3 changes: 3 additions & 0 deletions tools/build_defs/repo/preamb.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
layout: documentation
title: Repository rules
---

The following functions can be loaded from
`@bazel_tools//tools/build_defs/repo:BZL_FILE_BASE_NAME.bzl`.

0 comments on commit 902e7e5

Please sign in to comment.