I am exploring Node, Express and Jade and have found it generating single-line concatenated HTML code line. Needless to say this is quite an inconvenience when the task is to explore how the things work and debug my first apps. Can it be configured to generate code intended for a human to read? I mean with tags starting on new lines and tags hierarchy outlined with reasonable indentation?
Asked
Active
Viewed 173 times
0
-
`-P, --pretty : compile pretty html output` – elclanrs Apr 22 '14 at 02:09
-
1Also http://stackoverflow.com/questions/5276892/expressjs-how-to-output-pretty-html – elclanrs Apr 22 '14 at 02:11
-
That question-answer helped, @elclanrs, thanks – Ivan Apr 22 '14 at 02:23
1 Answers
2
If you are using jade API, you can use jade.compile(template, { pretty: true })(model)
.

Shaun Xu
- 4,476
- 2
- 27
- 41
-
Unfortunately I have no idea where to put this yet :-] So I am going with `App.locals.pretty = true;` for now... Thank you for your answer anyway. – Ivan Apr 22 '14 at 02:28