pugjs / pug-filters Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://github.com/pugjs/pug/tree/master/packages/pug-filters
Home Page: https://github.com/pugjs/pug/tree/master/packages/pug-filters
We should support passing in options for a given filter as an argument to the handleFilters method. That way I can tell pug that all markdown on a page should use a given highlighter by doing:
pug.compileFile(filename, {
filterOptions:
'markdown-it': {highlight: function (code, lang) { /*...*/ }}
}
});
I've just discovered "IcedCoffeeScript" which is "a superset of CoffeeScript".
It looks very interesting. It supports await
and defer
, which makes asynchronous programming easier.
A documentation is here: http://maxtaco.github.io/coffee-script/
Maybe it's worth to add a filter, like :icedcoffee
for it. doublerebel
has also added gulp support for it:
https://github.com/doublerebel/gulp-iced-coffee
It would be good if there was an option you could pass in to say that :markdown
should use jstransformer-markdown-it
, making it easier to swap markdown implementation later.
See pugjs/pug#2440 and #17.
ok, so I spent an entire day trying to get jade filters to work with gulp, namely, markdown, stylus, and coffeescript
the jade documentation is not helpful
http://jade-lang.com/reference/filters/
the jstransformers page it points to is not helpful
https://github.com/jstransformers/jstransformer
the gulp-jstransform page is not helpful
https://github.com/jstransformers/gulp-jstransformer
the jstransformer-stylus page is not helpful
https://www.npmjs.com/package/jstransformer-stylus
the conversations on the subject are not helpful at all
jstransformers/jstransformer#17
pugjs/pug#1928
Please guys, not everyone is a javascript ninja, get your documentation on the subject easier to understand. If filters are a part of jade, how can they be implemented in something like gulp?
There's not gulp gists with an example, nothing relavent I could find through hours of looking through google searches and stack overflow, I feel like I'm going in circles. Please help.
Thank you for your time.
If i define filter's options in filterOptions
section it merged in pure filters, but doesnt into filters with include block. E.g.:
let compile = pug.renderFile(path.join(inputDir, `${file}.pug`), {
pretty: true,
plugins: [cssModules],
filterOptions: {
"scss": {
modules: true,
includePaths: ['../app/styles', '../app/styles/images'],
outputStyle: 'compressed',
},
}
});
works fine:
style
:scss
body {
background-color: #989898;
}
doesn't work:
style
include:scss ./styles-pug.scss
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.