D
D
DaniilKhanin2016-04-22 02:57:19
Pug
DaniilKhanin, 2016-04-22 02:57:19

How to get readable layout from Jade?

Good day, I decided to use jade. Created index.jade with this content

doctype html
html(lang="en")
  head
    title= pageTitle
    script(type='text/javascript').
      if (foo) {
         bar(1 + 5)
      }
  body
    h1 Jade - node template engine
    #container.col
      if youAreUsingJade
        p You are amazing
      else
        p Get on it!
      p.
        Jade is a terse and simple
        templating language with a
        strong focus on performance
        and powerful features.

at the output I get
<!DOCTYPE html><html lang="en"><head><title></title><script type="text/javascript">if (foo) {
   bar(1 + 5)
}</script></head><body><h1>Jade - node template engine</h1><div id="container" class="col"><p>Get on it!</p><p>Jade is a terse and simple
templating language with a
strong focus on performance
and powerful features.</p></div></body></html>

Is that how it should be??!!!! Yes, the attachments have been preserved, but the layout is not readable !!!))) Is it possible to fix this somehow in a non-manual way?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Velichko, 2016-04-22
@DaniilKhanin

Use the pretty option: true // 2 spaces '\t' tabs
jade-lang.com/api
Can be additionally run with pretfire because mixins are not properly formatted.
For example gulp-prettify How to remove extra padding when compiling Jade in mixins?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question