Skip to content

Commit

Permalink
add preview
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Aug 29, 2010
1 parent adc997d commit 7eda41a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/app-talks.js
@@ -1,7 +1,27 @@
var fab = require("./fab")
, app = require('./app')
, Slide = require('./slide').Slide

with(fab) module.exports = (fab)
(route, /^\/preview/)
(function(write) {
return write(function(write, head, body) {
return fab.stream(function(stream) {
var text = ''
body(function(chunk) {
if(chunk)
text += chunk.toString('utf8')
else {
Slide.parse(text)(function(html) {
stream(write(html))
stream(write())
})
}
})
})
})
})
()
(route, /^\/([^\/]+)/) // :name
(route, /^\/slides/)
(app.static.html, 'slides')
Expand Down

0 comments on commit 7eda41a

Please sign in to comment.