From 95bbc1331e20eb3f52e4ec056f5026b51484b107 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Tue, 31 Oct 2017 10:15:39 +0100 Subject: [PATCH] integrate sphinx documentation generation --- publish.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/publish.py b/publish.py index 727ff51..29778dd 100755 --- a/publish.py +++ b/publish.py @@ -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)