Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better support for custom jade runtimes

  • Loading branch information...
commit 80b8b3cc08e9a7148aa84e218cd07db4f2a05107 1 parent c6296b9
@contra contra authored
Showing with 4 additions and 6 deletions.
  1. +1 −1  README.md
  2. +1 −1  bin/jaded
  3. +1 −3 lib/main.coffee
  4. +1 −1  package.json
View
2  README.md
@@ -32,7 +32,7 @@ sudo npm install jaded -g
-i --input [folder] Specify input folder
-o --output [folder] Specify output folder
-d --development Beautify output and insert line numbers
- -a --amd Wrap output in AMD closure
+ -a --amd [jade] Wrap output in AMD closure
```
View
2  bin/jaded
@@ -11,7 +11,7 @@ program
.option('-i --input [folder]', 'Specify input folder', '.')
.option('-o --output [folder]', 'Specify output folder', '.')
.option('-d --development', 'Beautify output and insert line numbers')
- .option('-a --amd', 'Wrap output in AMD closure')
+ .option('-a --amd [jade]', 'Wrap output in AMD closure')
.parse(process.argv)
indir = join process.cwd(), program.input
View
4 lib/main.coffee
@@ -6,7 +6,6 @@ module.exports =
beautify: (code, indent=2) -> uglify.gen_code parser.parse(code), beautify: true, indent_level: indent
compile: (contents, opt={}) ->
opt.development ?= false
- opt.amd ?= false
contents = String contents # for buffers
# Jade compile to function string
@@ -16,7 +15,6 @@ module.exports =
src = String jade.compile contents, opts
# Wrap in amd closure
- #src = "define(['jade'], function(jade) {return #{src};});" if opt.amd
- src = "define(function(jade) {return #{src};});" if opt.amd
+ src = "define(['#{opt.amd}'], function(jade) {return #{src};});" if opt.amd?
src = (if opt.development then module.exports.beautify(src) else module.exports.minify(src))
return src
View
2  package.json
@@ -1,7 +1,7 @@
{
"name":"jaded",
"description":"Alternative Jade CLI",
- "version":"0.0.1",
+ "version":"0.0.2",
"homepage":"http://github.com/wearefractal/jaded",
"repository":"git://github.com/wearefractal/jaded.git",
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
Please sign in to comment.
Something went wrong with that request. Please try again.