diff -r 820b22e13ff1 -r 39c28ec933dd buildframework/helium/tools/common/docs.ant.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buildframework/helium/tools/common/docs.ant.xml Mon May 10 19:54:49 2010 +0100 @@ -0,0 +1,298 @@ + + + + + + Documentation generation targets. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + doc: xml(${database.file}) + + + + + + Processing dot file: @{dot.file} + + + + + + + + + + + + + + + + + + + + + + + ant: antProperties() + doc: xml(${database.file}) + + + + + + + + + + + + +import html2rest +import os +import codecs +#import traceback +for root, dirs, files in os.walk(r'${docs.build.dir}/api', topdown=False): + for fname in files: + if '.html' in fname: + filename = os.path.abspath(os.path.join(root, fname)) + rstfilename = filename.replace('.html', '.rst') + try: + out = open(rstfilename, 'w') + html2rest.html2rest(html2rest.readsoup(filename), out) + except: + #traceback.print_exc() + print filename + ' failed to be converted to rst' + finally: + out.close() + + try: + rstfile = codecs.open(rstfilename, 'r', 'utf8') + rstfile.read() + except: + print rstfilename + ' has invalid unicode' + rstfile.close() + os.remove(rstfilename) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Building docs into ${docs.build.dir}. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ant: antProperties() + project: antProject() + + + + + + + + + + + + + + Building dot file: @{dot.file} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +