Changeset 3353
- Timestamp:
- 06/17/07 09:21:09 (1 year ago)
- Files:
-
- sandbox/crschmidt/docs/tools/class_template.html (modified) (1 diff)
- sandbox/crschmidt/docs/tools/html_docs.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/crschmidt/docs/tools/class_template.html
r3349 r3353 60 60 #for $prop in $class[$i.lower()]: 61 61 <div id="$prop['name']"> 62 <b>$prop['name']</b><br /> 62 <b>$prop['name']</b> 63 <p>$prop['docstring']</p> 63 64 #if $prop['info'].has_key('function_sig'): 64 65 Function signature: <b>$prop['info']['function_sig']</b><br /> sandbox/crschmidt/docs/tools/html_docs.py
r3349 r3353 3 3 import os 4 4 5 6 out_dir = "docs" 7 web_out = "http://crschmidt.net/~crschmidt/docs/" 8 5 from optparse import OptionParser 6 parser = OptionParser() 7 parser.add_option("--js", dest="js_files", help="Location of Javascript files", default="../lib/OpenLayers") 8 parser.add_option("--web", dest="web_location", help="Absolute path of output HTML", default="/docs/") 9 parser.add_option("--dir", dest="local_dir", help="Relative filesystem path of output", default="docs") 10 parser.add_option("--template_dir", dest="template_dir", help="Location of doc templates", default=".") 11 (options, args) = parser.parse_args() 9 12 out = {} 10 13 11 for root, dirs, files in os.walk( '../lib/OpenLayers'):14 for root, dirs, files in os.walk(options.js_files): 12 15 for filename in files: 13 16 file = os.path.join(root, filename) … … 16 19 out.update(docs.extract_docs_from_file(file)) 17 20 18 keys = out.keys()21 keys = out.keys() 19 22 keys.sort() 20 23 for key in keys: 21 24 out_filename = "OpenLayers/%s.html" % "/".join(key.split(".")) 22 if not os.access("%s/%s" % (o ut_dir, "/".join(out_filename.split("/")[0:-1])), os.R_OK):23 os.makedirs("%s/%s" % (o ut_dir, "/".join(out_filename.split("/")[0:-1])))24 fh = open("%s/%s" % (o ut_dir, out_filename), "w")25 data = str(Template( file = " class_template.html", searchList=[{'web_base':web_out, 'name':key, 'class': out[key]}]))25 if not os.access("%s/%s" % (options.local_dir, "/".join(out_filename.split("/")[0:-1])), os.R_OK): 26 os.makedirs("%s/%s" % (options.local_dir, "/".join(out_filename.split("/")[0:-1]))) 27 fh = open("%s/%s" % (options.local_dir, out_filename), "w") 28 data = str(Template( file = "%s/class_template.html" % options.template_dir, searchList=[{'web_base':options.web_location, 'name':key, 'class': out[key]}])) 26 29 fh.write(data) 27 30 fh.close() … … 30 33 31 34 for key in keys: 32 html += "<li><a href=' /~crschmidt/docs/OpenLayers/%s.html'>OpenLayers.%s</a>" % (key.replace(".", "/"), key)35 html += "<li><a href='OpenLayers/%s.html'>OpenLayers.%s</a>" % (key.replace(".", "/"), key) 33 36 34 37 html += "</ul>" 35 38 36 fh = open(" docs/index.html","w")39 fh = open("%s/index.html" % options.local_dir,"w") 37 40 fh.write(html) 38 41 fh.close()
