pug--HTML模板引擎安装编译
来源:互联网 发布:王自如 罗永浩 知乎 编辑:程序博客网 时间:2024/04/28 21:44
刚开始学pug的时候有点不明白,然后各种搜索,后来才知道pug就是jade,原名叫jade,现在更名为pug而已。可能刚改名没有多久吧,搜pug资料很少。我也刚开始学习,希望对大家会有帮助。
1、首先要通过node.js的npm来安装pug,直接在cmd里面输入npm install -g pug 前提是你安装了node和npm (网上安装教程很多,这里就不赘述了),还需要安装cli npm install -g pug-cli ,不然会出现pug not found。 -g表示全局安装
2、写一个test.pug文件,在cmd里进入test.pug的目录下,输入pug test.pug 回车即可出现rendered test.html。输入pug -P -w test.pug比较好,因为输出的html格式会好看,并且是被监听的,修改test.pug的时候,只要保存,html会及时更新。
test.pug简单代码如下:
doctype htmlheadmeta(charset='utf-8')title First file of pugbodyh1 This is my first pugdiv.div1 p that some content in herei point编译成html之后代码如下:
<!DOCTYPE html><head> <meta charset="utf-8"> <title>First file of pug</title></head><body> <h1>This is my first pug</h1> <div> <div class="div1"> </div> <p>that some content in here<i>point</i></p> </div></body>
1 0
- pug--HTML模板引擎安装编译
- pug--HTML模板引擎安装编译
- Jade/pug-HTML模板引擎
- pug的安装和编译
- HTML与PUG互相编译的方法
- github项目学习--Vue结合Pug模板引擎
- Webpack 3.x 尝试使用Pug(Jade)模板引擎
- pug模板初体验
- 在angular-cli项目中使用Scss和Pug(Jade)模板引擎
- HTML模板引擎
- Smarty模板引擎安装
- 短小精悍的HTML模板引擎
- HTML模板渲染引擎Hogan
- HTML模板引擎-freemarker入门
- 【Web】artTemplate模板引擎:编译(生成渲染函数)+渲染(生成HTML串) 模板:基于JS的语法(JS+自定义)+HTML
- pug模板的使用及终端
- windows安装smarty模板引擎
- Smarty模板引擎的安装
- orb-slam中的orb项目源码解析
- cpu cmpxchg 指令理解 (CAS)
- mysql学习的方方面面
- Xamarin.ios 使用webview加载gif图片
- 33. Search in Rotated Sorted Array
- pug--HTML模板引擎安装编译
- method to solve the problem : Could not cast value of type 'NSManagedObject_ to
- github readme添加图片
- 有些类也需要计划生育--单例模式
- Step
- 【Android】Android五种数据传递方法汇总
- 2016年11月30日 angularJS input=file 绑定change事件
- 进程同步的经典问题1——读者写者问题(写者优先与公平竞争)
- 设计模式学习笔记--迭代器模式