Question

I'm using jade/pug template engine with ExpressJS on Node.js. It outputs a html with single line. No indentation at all. I couldn't find any beautifier option.

Was it helpful?

Solution

There used to be a {pretty: true} option but it was removed because it messed up with whitespaces.

Refs:

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

OTHER TIPS

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

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

If you are compileing from console, then you can use this :

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

it will generate beutyfied code in html folder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top