docs: replace scripts with makefile
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2348>
This commit is contained in:
parent
c5dd88a2e2
commit
fe47420ba1
14 changed files with 538 additions and 3473 deletions
19
docs/_scripts/locale-prune-untranslated.py
Executable file
19
docs/_scripts/locale-prune-untranslated.py
Executable 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
22
docs/_scripts/serve.py
Executable 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())
|
||||
Loading…
Add table
Add a link
Reference in a new issue