mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	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:
		| @@ -1,3 +1,22 @@ | |||||||
| #!/usr/bin/env bash | #!/usr/bin/env python3 | ||||||
| set -eu |  | ||||||
| make -C "$(dirname "$0")"/../docs clean html | # 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() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user