You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-14
Original file line number
Diff line number
Diff line change
@@ -21,27 +21,30 @@ Full documentation is at [pugjs.org](https://pugjs.org/)
21
21
22
22
## Rename from "Jade"
23
23
24
-
This project was formerly known as "Jade". However, it has been revealed to us that "Jade" is a registered trademark, and as a result, a rename is needed. After some discussion among the maintainers, **"Pug"**has been chosen as the new name for this project. The next major version will carry "pug" as the package name.
24
+
This project was formerly known as "Jade". However, it was revealed to us that "Jade" is a registered trademark; as a result, a rename was needed. After some discussion among the maintainers, **"Pug"**was chosen as the new name for this project. As of version 2, "pug" is the official package name.
25
25
26
26
If your package or app currently uses `jade`, don't worry: we have secured permissions to continue to occupy that package name, although all new versions will be released under `pug`.
27
27
28
-
Before the renaming, we had already begun working on an incompatible Jade 2.0.0. We have then made it so that this new major version bump will coincide with the rename to Pug. Therefore, upgrading from Jade to Pug will be the same process as upgrading any other package with a major version bump. Currently, Pug 2.0.0 is still in beta stage, and there are several syntactic differences we have deprecated and removed. Such differences are documented at [#2305](https://github.com/pugjs/pug/issues/2305).
28
+
Before the renaming, work had already begun on “Jade 2.0.0”. Therefore, the rename to Pug coincided with the major version bump. As a result, upgrading from Jade to Pug will be the same process as upgrading any other package with a major version bump.
29
29
30
-
The website and documentation for Pug are still being updated, but if you are new to Pug, you should get started with the new syntax and install the Pug package on npm.
30
+
The syntax of Pug has several differences, deprecations, and removals compared to its predecessor. These differences are documented in [#2305](https://github.com/pugjs/pug/issues/2305).
31
+
32
+
The website and documentation for Pug are still being updated. But if you are new to Pug, you should get started with the new syntax and install the Pug package from npm.
31
33
32
34
## Installation
33
35
34
36
### Package
35
37
36
-
via npm:
38
+
To use Pug in your own JavaScript projects:
37
39
38
40
```bash
39
41
$ npm install pug
40
42
```
41
43
44
+
42
45
### Command Line
43
46
44
-
After installing the latest version of [Node.js](http://nodejs.org/), install with:
47
+
After installing the latest version of [Node.js](http://nodejs.org), install with:
45
48
46
49
```bash
47
50
$ npm install pug-cli -g
@@ -55,7 +58,7 @@ $ pug --help
55
58
56
59
## Syntax
57
60
58
-
Pug is a clean, whitespace sensitive syntax for writing html. Here is a simple example:
61
+
Pug is a clean, whitespace sensitive syntax for writing HTML. Here is a simple example:
59
62
60
63
```pug
61
64
doctype html
@@ -76,7 +79,7 @@ html(lang="en")
76
79
strong focus on performance and powerful features.
77
80
```
78
81
79
-
becomes
82
+
Pug transforms the above to:
80
83
81
84
82
85
```html
@@ -120,11 +123,11 @@ var html = pug.renderFile('filename.pug', merge(options, locals));
120
123
121
124
-`filename` Used in exceptions, and required when using includes
122
125
-`compileDebug` When `false` no debug instrumentation is compiled
123
-
-`pretty` Add pretty-indentation whitespace to output _(false by default)_
126
+
-`pretty` Add pretty-indentation whitespace to output _(`false` by default)_
124
127
125
128
## Browser Support
126
129
127
-
The latest version of pug can be download for the browser in standalone form from [here](https://pugjs.org/js/pug.js). It only supports the very latest browsers though, and is a large file. It is recommended that you pre-compile your pug templates to JavaScript.
130
+
The latest version of pug can be [downloaded for the browser in standalone form](https://pugjs.org/js/pug.js). It only supports the very latest browsers, though, and is a large file. It is recommended that you pre-compile your pug templates to JavaScript.
128
131
129
132
To compile a template for use on the client using the command line, do:
130
133
@@ -144,7 +147,7 @@ which will produce `filename.js` containing the compiled template.
144
147
145
148
### Ports in other languages
146
149
147
-
Ports with very close syntax, adapted to other languages:
150
+
Ports to other languages, with very close syntax:
148
151
149
152
-[PHP](https://github.com/pug-php/pug)
150
153
-[Java](https://github.com/neuland/jade4j)
@@ -154,12 +157,11 @@ Ports with very close syntax, adapted to other languages:
154
157
155
158
### Equivalents in other languages
156
159
157
-
158
-
Templates engines available in other languages with a different syntax but a similar philosophy:
160
+
Templates engines for other languages with a different syntax, but a similar philosophy:
159
161
160
162
-[Scaml for Scala](https://scalate.github.io/scalate/documentation/scaml-reference.html)
161
163
-[Slim for Ruby](https://github.com/slim-template/slim) (should not be confused with Slim PHP framework)
162
-
-[HAML for Ruby](http://haml.info/)
164
+
-[HAML for Ruby](http://haml.info)
163
165
164
166
### Framework implementations/adapters
165
167
@@ -188,7 +190,7 @@ Embedded view engines for frameworks:
-[Pug Server](https://github.com/ctrlaltdev/pug-server) Ideal for building local prototypes apart from any application
191
-
-[cache-pug-templates](https://github.com/ladjs/cache-pug-templates) Cache Pug templates for [Lad](https://github.com/ladjs/lad)/[Koa](https://github.com/koajs/koa)/[Express](https://github.com/expressjs/express)/[Connect](https://github.com/senchalabs/connect) with [Redis](https://redis.io/)
193
+
-[cache-pug-templates](https://github.com/ladjs/cache-pug-templates) Cache Pug templates for [Lad](https://github.com/ladjs/lad)/[Koa](https://github.com/koajs/koa)/[Express](https://github.com/expressjs/express)/[Connect](https://github.com/senchalabs/connect) with [Redis](https://redis.io)
0 commit comments