Created
August 8, 2012 00:24
-
-
Save mdlawson/3290867 to your computer and use it in GitHub Desktop.
Parser demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task 'doc', 'Build docs', -> | |
| fs = require 'fs' | |
| dox = require '../dox' | |
| jade = require 'jade' | |
| fs.readFile 'doc/template.jade', 'utf-8', (err,tmpl) -> | |
| fn = jade.compile tmpl | |
| for file in files | |
| code =fs.readFileSync "src/#{file}.coffee", 'utf-8' | |
| json = dox.parseComments code | |
| html = fn({"dox":json,"file":file}) | |
| fs.writeFileSync "doc/#{file}.html",html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| doctype 5 | |
| html(lang="en") | |
| head | |
| title= "Rogue Docs" | |
| script(src='highlight.pack.js') | |
| link(rel='stylesheet', href='styles/monokai.css') | |
| script | |
| hljs.initHighlightingOnLoad(); | |
| body | |
| ul | |
| each item in dox | |
| li | |
| h3= "Description" | |
| p!= item.description.full | |
| h3= "Code" | |
| pre | |
| code.coffeescript= item.code | |
| ul | |
| each child in item.children | |
| li | |
| h3= "Description" | |
| p!= child.description.full | |
| h3= "Code" | |
| pre | |
| code.coffeescript= child.code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment