integrate sphinx documentation generation
This commit is contained in:
parent
e951c3b9b2
commit
95bbc1331e
19
publish.py
19
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)
|
||||
|
|
Loading…
Reference in New Issue