Permalink
Browse files

Add HTML documentation to web.py output

  • Loading branch information...
1 parent cb674b3 commit 8040ed4f74d8849d4732c5d9b72b46156e4edddf @pneff committed Jun 23, 2008
Showing with 13 additions and 8 deletions.
  1. +0 −1 README.markdown
  2. +13 −7 gen.py
View
@@ -53,7 +53,6 @@ On a shell execute gen.py like this:
- Specified but to implement:
- Caching
- Caching of output blocks
- - Inherent documentation for web.py target at /__docs or similar
- Language improvements:
- Re-use output blocks
View
20 gen.py
@@ -10,17 +10,23 @@ def main():
tree = service.parse(filename)
# Generator("debug", tree.tree).write("out")
- targets = {
- 'webpy': 'python-webpy',
- 'html' : 'html',
- }
+ targets = (
+ # Name, Template, Outdir
+ ('webpy', 'python-webpy', 'webpy'),
+ ('html', 'html', 'webpy/static/docs/'),
+ ('html', 'html', 'html'),
+ )
- for name, template in targets.iteritems():
+ for target in targets:
+ type = target[0]
+ template = target[1]
+ outdir = target[2]
+
gen = Generator("CodeTemplator", tree.tree)
gen.setOption("template", sys.path[0] + "/templates/" + template)
gen.setOption("sourcedir", os.path.dirname(filename))
- gen.setOption("type", name)
- gen.write("out/" + name)
+ gen.setOption("type", type)
+ gen.write("out/" + outdir)
if __name__ == "__main__":
main()

0 comments on commit 8040ed4

Please sign in to comment.