2019-08-25 20:15:03 +00:00
|
|
|
#! /usr/bin/python3 -B
|
|
|
|
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
|
2020-05-25 09:21:58 +00:00
|
|
|
import sphinx.cmd.build
|
2019-08-25 20:15:03 +00:00
|
|
|
|
|
|
|
INPUT = ["docs"]
|
|
|
|
OUTPUT = "out"
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
file = os.path.realpath(__file__)
|
|
|
|
directory = os.path.dirname(file)
|
|
|
|
output_directory = os.path.join(directory, OUTPUT)
|
|
|
|
shutil.rmtree(output_directory, ignore_errors=True)
|
|
|
|
for doc in INPUT:
|
|
|
|
arguments = [
|
|
|
|
"-E",
|
|
|
|
"-j", "2",
|
|
|
|
"-b", "html",
|
|
|
|
"-D", "project={}".format(doc),
|
|
|
|
"-D", "master_doc={}".format("index"),
|
|
|
|
"-D", "html_theme={}".format("sphinx_rtd_theme"),
|
|
|
|
# "-C",
|
|
|
|
"-c", directory,
|
|
|
|
os.path.join(directory, doc),
|
|
|
|
os.path.join(output_directory, doc),
|
|
|
|
]
|
2020-05-25 09:21:58 +00:00
|
|
|
sphinx.cmd.build.build_main(arguments)
|
2019-08-25 20:15:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|