# 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)
- 前言
- 1 skill
- 1.1 Coding WebIDE
- 1.2 git
- 1.3 extra practice
- 1.4 预习
- 2 nodejs入门
- 2.1 入门
- 2.2 安装
- 2.3 helloworld
- 2.4 commonJS规范
- 2.5 模块导出
- 2.6 Nodejs代码调试
- 2.7 编写Nodejs模块
- 2.8 最小化问题
- 2.9 随堂练习
- 3 异步流程控制
- 3.1 什么时候会用到异步流程控制
- 3.2 简单做法async模块
- 3.3 Promise/a+规范
- 3.4 Node.js Promise/a+实现
- 3.5 生成器Generators/yield
- 3.6 Async函数/Await
- 3.7 神奇的co
- 3.8 5种 yieldable
- 3.9 学习重点
- 3.10 随堂练习
- 4 express和微信开发入门
- 4.1 入门
- 4.2 connect
- 4.3 静态Http服务器
- 4.4 那些预处理器
- 4.5 路由
- 4.6 视图与模块引擎
- 4.7 中间件
- 4.8 更多实践
- 4.9 微信入门
- 4.10 随堂练习:完成登录、注册功能
- 5 微信实例与H5实践
- 5.1 微信基础和sandbox
- 5.2 公众号菜单和自动回复
- 5.3 微信OAuth用户授权
- 5.4 微信分享
- 5.5 wechat-api
- 5.6 H5-上篇
- 5.7 H5-下篇
- 5.8 随堂练习
- 6 weui实战
- 6.1 使用bower
- 6.2 移动端抽象
- 6.3 优化滑动列表
- 6.4 weui
- 6.5 让weui和iscroll结婚
- 6.6 优化事件
- 6.7 how-to-write-h5
- 6.8 优化无止境
- 6.9 随堂练习
- 7 微信支付
- 7.1 吹个牛
- 7.2 支付概述
- 7.3 科普几个概念
- 7.4 准备
- 7.5 调试
- 7.6 公众号支付(JSAPI)
- 7.7 对账单
- 7.8 数据处理
- 7.9 随堂练习
- 8 项目实战《付费课程系统MVP》
- 8.1 需求分析
- 8.2 ui/ue
- 8.3 技术栈
- 8.4 模型
- 8.5 静态api
- 8.6 开发
- 8.7 部署
- 8.8 监控
- 8.9 数据统计
- 8.10 demo
- 9 高级篇
- 9.1 前后端分离实践?
- 9.2 如何展望未来的大前端
- 9.3 容器和微服务
- 10 答疑问题收集