4.6 视图与模块引擎

最后更新于:2022-04-01 23:33:37

# view && template ## 设置 ~~~ // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); ~~~ ## jade jade学习 * [http://jade-lang.com/reference/](http://jade-lang.com/reference/) * [https://github.com/i5ting/study-jade](https://github.com/i5ting/study-jade) html转jade是比较省力的一种方法 使用场景:尤其是写bootstrap的时候,当然静态页面转jade也一样 hade是一个html2jade.org的copy,平常打开这个网站比较慢,索性还是在本地弄一个,用的时候一条命令打开 ~~~ [sudo] npm install -g hade hade ~~~ ![](https://github.com/i5ting/hade/raw/master/ScreenShot.png) 好处 * html和jade互转 * 对于学习jade是比较好的练习 详见[https://github.com/i5ting/hade](https://github.com/i5ting/hade) ## more Template engine consolidation library for node.js [https://github.com/tj/consolidate.js](https://github.com/tj/consolidate.js) ## Supported template engines * [atpl](https://github.com/soywiz/atpl.js) * [doT.js](https://github.com/olado/doT) [(website)](http://olado.github.io/doT/) * [dust (unmaintained)](https://github.com/akdubya/dustjs) [(website)](http://akdubya.github.com/dustjs/) * [dustjs-linkedin (maintained fork of dust)](https://github.com/linkedin/dustjs) [(website)](http://linkedin.github.io/dustjs/) * [eco](https://github.com/sstephenson/eco) * [ect](https://github.com/baryshev/ect) [(website)](http://ectjs.com/) * [ejs](https://github.com/visionmedia/ejs) * [haml](https://github.com/visionmedia/haml.js) [(website)](http://haml-lang.com/) * [haml-coffee](https://github.com/9elements/haml-coffee) [(website)](http://haml-lang.com/) * [hamlet](https://github.com/gregwebs/hamlet.js) * [handlebars](https://github.com/wycats/handlebars.js/) [(website)](http://handlebarsjs.com/) * [hogan](https://github.com/twitter/hogan.js) [(website)](http://twitter.github.com/hogan.js/) * [htmling](https://github.com/codemix/htmling) * [jade](https://github.com/visionmedia/jade) [(website)](http://jade-lang.com/) * [jazz](https://github.com/shinetech/jazz) * [jqtpl](https://github.com/kof/node-jqtpl) [(website)](http://api.jquery.com/category/plugins/templates/) * [JUST](https://github.com/baryshev/just) * [liquor](https://github.com/chjj/liquor) * [lodash](https://github.com/bestiejs/lodash) [(website)](http://lodash.com/) * [mote](https://github.com/satchmorun/mote) [(website)](http://satchmorun.github.io/mote/) * [mustache](https://github.com/janl/mustache.js) * [nunjucks](https://github.com/mozilla/nunjucks) [(website)](https://mozilla.github.io/nunjucks) * [QEJS](https://github.com/jepso/QEJS) * [ractive](https://github.com/Rich-Harris/Ractive) * [react](https://github.com/facebook/react) * [swig](https://github.com/paularmstrong/swig) [(website)](http://paularmstrong.github.com/swig/) * [templayed](http://archan937.github.com/templayed.js/) * [liquid](https://github.com/leizongmin/tinyliquid) [(website)](http://liquidmarkup.org/) * [toffee](https://github.com/malgorithms/toffee) * [underscore](https://github.com/documentcloud/underscore) [(website)](http://documentcloud.github.com/underscore/) * [walrus](https://github.com/jeremyruppel/walrus) [(website)](http://documentup.com/jeremyruppel/walrus/) * [whiskers](https://github.com/gsf/whiskers.js)
';