mirror of https://github.com/zulip/zulip.git
docs: Rewrite tools/build-docs in python.
Change the script to python. This is done for the following reasons. * It enables us to use the sanity_check. * Later when we add warning to include --clean flag we can use the pre-existing WARNING from zulip_tools rather than using terminal color codes. TODO: Currently this script is slow as the clean option is expensive so instead use only html by default and clean only if --clean option is passed. Part of #17961.
This commit is contained in:
parent
a1d0fa5cbb
commit
94afc72764
|
@ -1,3 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
make -C "$(dirname "$0")"/../docs clean html
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# check for the venv
|
||||
from lib import sanity_check
|
||||
|
||||
sanity_check.check_venv(__file__)
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.append(ZULIP_PATH)
|
||||
from scripts.lib.zulip_tools import run
|
||||
|
||||
|
||||
def main() -> None:
|
||||
path = os.path.join(ZULIP_PATH, "docs")
|
||||
run(["make", "clean", "html", "-C", path])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue