2019-09-08 20:15:32 +02:00
|
|
|
#! /usr/bin/python3 -B
|
|
|
|
|
|
|
|
import os
|
|
|
|
import shutil
|
2020-04-27 22:42:53 +02:00
|
|
|
import subprocess
|
2019-09-08 20:15:32 +02:00
|
|
|
|
2020-05-19 16:50:44 +02:00
|
|
|
import sphinx.cmd.build
|
2019-09-08 20:15:32 +02:00
|
|
|
|
2023-01-05 22:40:10 +01:00
|
|
|
TRAVAUX = [
|
|
|
|
# 'thesis',
|
|
|
|
]
|
2020-09-26 00:52:12 +02:00
|
|
|
INPUT = ['cnam']
|
|
|
|
OUTPUT = 'out'
|
2019-09-08 20:15:32 +02:00
|
|
|
|
|
|
|
|
2020-04-27 12:46:18 +02:00
|
|
|
def others():
|
2020-10-30 10:29:30 +01:00
|
|
|
travaux = os.path.join('cnam')
|
2020-04-27 22:42:53 +02:00
|
|
|
for travail in TRAVAUX:
|
|
|
|
subprocess.call([os.path.join(travaux, travail, 'build.py')])
|
2020-04-27 12:46:18 +02:00
|
|
|
|
|
|
|
|
2019-09-08 20:15:32 +02:00
|
|
|
def main():
|
|
|
|
file = os.path.realpath(__file__)
|
|
|
|
directory = os.path.dirname(file)
|
2020-04-27 22:42:53 +02:00
|
|
|
os.chdir(directory)
|
|
|
|
others()
|
2019-09-08 20:15:32 +02:00
|
|
|
output_directory = os.path.join(directory, OUTPUT)
|
|
|
|
shutil.rmtree(output_directory, ignore_errors=True)
|
|
|
|
for doc in INPUT:
|
|
|
|
arguments = [
|
2020-09-26 00:52:12 +02:00
|
|
|
'-E',
|
|
|
|
'-j', '2',
|
|
|
|
'-b', 'html',
|
|
|
|
'-D', 'project={}'.format(doc),
|
|
|
|
'-D', 'master_doc={}'.format('index'),
|
|
|
|
'-D', 'html_theme={}'.format('sphinx_rtd_theme'),
|
|
|
|
# '-C',
|
|
|
|
'-c', directory,
|
2019-09-08 20:15:32 +02:00
|
|
|
os.path.join(directory, doc),
|
|
|
|
os.path.join(output_directory, doc),
|
|
|
|
]
|
2020-05-19 16:50:44 +02:00
|
|
|
sphinx.cmd.build.build_main(arguments)
|
2019-09-08 20:15:32 +02:00
|
|
|
|
|
|
|
|
2020-09-26 00:52:12 +02:00
|
|
|
if __name__ == '__main__':
|
2019-09-08 20:15:32 +02:00
|
|
|
main()
|