Skip to content

Commit

Permalink
Split the Starlark docs into Build APIs vs not
Browse files Browse the repository at this point in the history
Summary: Useful to distinguish what is pure Starlark vs our build extensions, and thus what makes sense in targets files vs rules.

Reviewed By: stepancheg

Differential Revision: D44749219

fbshipit-source-id: 974730eafd69096cc0072cbe07a946f5cbb0e4eb
  • Loading branch information
ndmitchell authored and facebook-github-bot committed Apr 7, 2023
1 parent 046ae86 commit 1651def
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ def main() -> None:
dest = "rules"
prefix += "# Rules\n\nThese rules are available as standard in Buck2.\n"
src = "\n".join(src.splitlines()[1:])
elif x.endswith("/function.bzl"):
# Uninteresting docs we'd rather not have generated
continue
elif "/standard/" in x or "/extension/" in x or x.endswith("builtins.md"):
dest = "starlark/" + name
else:
dest = x[:-3]
dest = "build/" + x[7:-3]
dest = "docs/api/" + dest + ".generated.md"
os.makedirs(Path(dest).parent, exist_ok=True)
write_file(dest, prefix + src)
Expand Down
9 changes: 7 additions & 2 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,13 @@ const manualSidebar = [
},
{
type: 'category',
label: 'Rule APIs',
items: [{ type: 'autogenerated', dirName: 'api/native' }],
label: 'Starlark APIs',
items: [{ type: 'autogenerated', dirName: 'api/starlark' }],
},
{
type: 'category',
label: 'Build APIs',
items: [{ type: 'autogenerated', dirName: 'api/build' }],
},
{
type: 'category',
Expand Down

0 comments on commit 1651def

Please sign in to comment.