pug-coffee
v0.0.4
Published
Pug filter for coffeescript
Downloads
1
Readme
Setup filter
const pug = require('pug');
pug.filters.coffee = require('pug-coffee')();
Set filename for coffeescript when render
pug.filters.coffee = require('pug-coffee')(function (coffeeOptions, options) {
coffeeOptions.filename = options.filename;
});
Use filter
:coffee
alert 'hello'
Output:
function () {
return alert('hello');
}
Pretty render.
:coffee(uglify=false)
alert 'hello'
Output without uglify.
Render with bare mode.
:coffee(bare=true)
alert 'hello'
Output:
alert('hello');
Render with script tag.
:coffee(bare=true wrap=true)
alert 'hello'
Output:
<script>alert('hello');</script>