Skip to content

Commit

Permalink
Add HTML documentation to web.py output
Browse files Browse the repository at this point in the history
  • Loading branch information
pneff committed Jun 23, 2008
1 parent cb674b3 commit 8040ed4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion README.markdown
Expand Up @@ -53,7 +53,6 @@ On a shell execute gen.py like this:
- Specified but to implement: - Specified but to implement:
- Caching - Caching
- Caching of output blocks - Caching of output blocks
- Inherent documentation for web.py target at /__docs or similar
- Language improvements: - Language improvements:
- Re-use output blocks - Re-use output blocks


Expand Down
20 changes: 13 additions & 7 deletions gen.py
Expand Up @@ -10,17 +10,23 @@ def main():
tree = service.parse(filename) tree = service.parse(filename)
# Generator("debug", tree.tree).write("out") # Generator("debug", tree.tree).write("out")


targets = { targets = (
'webpy': 'python-webpy', # Name, Template, Outdir
'html' : 'html', ('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 = Generator("CodeTemplator", tree.tree)
gen.setOption("template", sys.path[0] + "/templates/" + template) gen.setOption("template", sys.path[0] + "/templates/" + template)
gen.setOption("sourcedir", os.path.dirname(filename)) gen.setOption("sourcedir", os.path.dirname(filename))
gen.setOption("type", name) gen.setOption("type", type)
gen.write("out/" + name) gen.write("out/" + outdir)


if __name__ == "__main__": if __name__ == "__main__":
main() main()

0 comments on commit 8040ed4

Please sign in to comment.