integrate sphinx documentation generation

This commit is contained in:
Christophe Siraut 2017-10-31 10:15:39 +01:00
parent e951c3b9b2
commit 95bbc1331e
1 changed files with 16 additions and 3 deletions

View File

@ -162,6 +162,14 @@ def publish_tarball(module):
file(output_filename, 'w').write(fd.read())
def publish_sphinx(module):
checkout_dir = os.path.join(checkouts_directory, module.get('name'))
output_dir = os.path.join(web_directory, module.get('name'))
build_dir = os.path.join(checkout_dir, '_build/html')
os.system('cd %s && make html' % checkout_dir)
shutil.copytree(build_dir, output_dir)
def create_index(modules):
index_html = os.path.join(web_directory, 'index.html')
t = Template(unicode(file('index_template.html').read(), 'utf-8'))
@ -182,9 +190,14 @@ for module in modules:
if module.get('directory'):
module['branch'] = 'stable'
publish_tarball(module)
else:
module['branch'] = 'dev'
publish_mallard(module, 'master', 'dev')
continue
if module.get('type') == "sphinx":
publish_sphinx(module)
continue
module['branch'] = 'dev'
publish_mallard(module, 'master', 'dev')
for js_file in os.listdir('js'):
shutil.copy('js/' + js_file, web_directory)