feat: refactoring for sphinx localisation support
This commit is contained in:
parent
368b4ba0c1
commit
bf5e7c383a
6 changed files with 189 additions and 33 deletions
17
docs/build_docs.py
Normal file
17
docs/build_docs.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import subprocess
|
||||
import os
|
||||
import yaml
|
||||
|
||||
with open('languages.yaml', 'r') as file:
|
||||
config = yaml.safe_load(file)
|
||||
languages = config.get('languages', [])
|
||||
|
||||
|
||||
def build_doc(language, dest_dir):
|
||||
os.environ['SPHINXOPTS'] = "-D language='{}'".format(language)
|
||||
subprocess.run(f"sphinx-build -b html . {dest_dir}", shell=True)
|
||||
|
||||
|
||||
build_doc("en", "../public")
|
||||
for language in languages:
|
||||
build_doc(language['code'], f"../public/{language['code']}")
|
Loading…
Add table
Add a link
Reference in a new issue