Pug / jade engine template: html beautifier?

I am using jade / pug template engine with ExpressJS on Node.js. It outputs html with one line. No indentation at all. I could not find any options for decoration.

+7
source share
3 answers

There used to be a {pretty: true} parameter, but it was removed because it messed up with spaces.

works:

https://github.com/visionmedia/jade/issues/#issue/91 https://github.com/visionmedia/jade/issues/closed/#issue/89

+4
source

In app.js, pass the pretty parameter to the Jade compiler.

 app.set('view options', { pretty: true }); 
+6
source

If you are compiling from the console, you can use this:

 jade views/ --out html --pretty layout.jade 

it will generate beutfied code in the html folder.

+1
source

All Articles