Created
August 16, 2011 12:06
-
-
Save tallica/1148935 to your computer and use it in GitHub Desktop.
This file contains 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
require 'execjs' | |
require 'open-uri' | |
source = open('https://raw.github.com/visionmedia/jade/master/jade.min.js').read | |
context = ExecJS.compile(source) | |
code = <<-CODE | |
(function(content, options) { | |
var jade = require("jade"); | |
return jade.render(content, options); | |
}) | |
CODE | |
content = <<-CODE | |
!!! 5 | |
html | |
head | |
body | |
h1 Hello World | |
CODE | |
puts context.call(code, content, {}) |
Author
tallica
commented
Aug 16, 2011
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment