Skip to content

Commit

Permalink
Make the rules look a bit nicer
Browse files Browse the repository at this point in the history
Summary: Give it a custom description. Ugly place to do it, but there really isn't a better place.

Reviewed By: stepancheg

Differential Revision: D44749216

fbshipit-source-id: 0a1781acdb9322fa7a47eddf3515374c00b458d7
  • Loading branch information
ndmitchell authored and facebook-github-bot committed Apr 7, 2023
1 parent bb7a50b commit 046ae86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def main() -> None:
)

for orig in Path(tmp).rglob("*.md"):
src = read_file(orig)
x = os.path.relpath(orig, tmp)
name = Path(x).stem
if name.endswith(".bzl"):
Expand All @@ -91,11 +92,13 @@ def main() -> None:
dest = x[7:-3]
elif x.endswith("/rules.bzl.md"):
dest = "rules"
prefix += "# Rules\n\nThese rules are available as standard in Buck2.\n"
src = "\n".join(src.splitlines()[1:])
else:
dest = x[:-3]
dest = "docs/api/" + dest + ".generated.md"
os.makedirs(Path(dest).parent, exist_ok=True)
write_file(dest, prefix + read_file(orig))
write_file(dest, prefix + src)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const manualSidebar = [
{
type: 'doc',
id: 'api/rules',
label: 'Rules API',
label: 'Rules',
},
{
type: 'category',
Expand Down

0 comments on commit 046ae86

Please sign in to comment.