docs: replace scripts with makefile

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2348>
This commit is contained in:
jo 2023-07-17 21:35:44 +02:00 committed by Marge
commit fe47420ba1
14 changed files with 538 additions and 3473 deletions

View file

@ -0,0 +1,19 @@
#!/usr/bin/env python3
import os
from subprocess import check_output
def main() -> int:
output = check_output(["poetry", "run", "sphinx-intl", "stat"], text=True)
for line in output.splitlines():
path, _, comment = line.partition(":")
if "0 untranslated." in comment:
print(f"removing untranslated po file: {path}")
os.unlink(path)
return 0
if __name__ == "__main__":
raise SystemExit(main())

22
docs/_scripts/serve.py Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env python3
from subprocess import check_call
from livereload import Server, shell
BUILD_DIR = "/tmp/_build"
def main() -> int:
# initial make
check_call(["make", "build", f"BUILD_DIR={BUILD_DIR}"])
server = Server()
server.watch("..", shell(f"make build BUILD_DIR={BUILD_DIR}"))
server.serve(root=BUILD_DIR, liveport=35730, port=8001, host="0.0.0.0")
return 0
if __name__ == "__main__":
raise SystemExit(main())