2021-04-07 12:59:03 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2021-04-08 07:33:44 +02:00
|
|
|
import argparse
|
2021-04-07 12:59:03 +02:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
sys.path.append(ZULIP_PATH)
|
2021-07-03 08:22:44 +02:00
|
|
|
|
|
|
|
# check for the venv
|
|
|
|
from tools.lib import sanity_check
|
|
|
|
|
|
|
|
sanity_check.check_venv(__file__)
|
|
|
|
|
2021-04-08 07:33:44 +02:00
|
|
|
from scripts.lib.zulip_tools import ENDC, WARNING, run
|
2021-04-07 12:59:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
def main() -> None:
|
2021-04-08 07:33:44 +02:00
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument("-c", "--clean", action="store_true")
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
2021-04-07 12:59:03 +02:00
|
|
|
path = os.path.join(ZULIP_PATH, "docs")
|
2021-04-08 07:33:44 +02:00
|
|
|
if not args.clean:
|
|
|
|
run(["make", "html", "-C", path])
|
|
|
|
print(
|
|
|
|
WARNING
|
|
|
|
+ "tools/build-docs --clean is necessary for the navigation/left sidebar to update."
|
|
|
|
+ ENDC
|
|
|
|
)
|
|
|
|
return
|
|
|
|
|
2021-04-07 12:59:03 +02:00
|
|
|
run(["make", "clean", "html", "-C", path])
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|