简体   繁体   English

我可以将Jade配置为生成可读的良好缩进的HTML代码而不是单行流吗?

[英]Can I configure Jade to generate readable well-indentated HTML code rather than single-line stream?

I am exploring Node, Express and Jade and have found it generating single-line concatenated HTML code line. 我正在探索Node,Express和Jade,并发现它生成单行连接的HTML代码行。 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? 我的意思是标签从新行开始,标签层次结构用合理的缩进标注?

如果您使用的是jade API,则可以使用jade.compile(template, { pretty: true })(model)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM