D
D
Dmitry Smirnov2017-03-13 15:45:15
Pug
Dmitry Smirnov, 2017-03-13 15:45:15

Kind of html code after pug?

Friends, probably a stupid question, but I'll ask it anyway.
I'm learning pug and I don't quite like the look of the html code that I get. For example, here is the pug code

header
    .header__up
        .container-fluid
            .row
                .col-md-1
                    a(href="#")
                        img(src='img/logo.png' alt='logo')
                .col-md-offset-6.col-md-5
                    .header__nav
                        .header__nav-search
                            input(type='text' placeholder='search website')
                            a.header__nav-search-btn(href="#")
                                img(src="img/fa_search.png" alt="search-logo")
                        a.header__nav-buy(href="#") buy $21
                        a.bars(href="#")
                            img(src="img/fa_bars.png" alt="bars")

This is what happens in html
<header>
      <div class="header__up">
        <div class="container-fluid">
          <div class="row">
            <div class="col-md-1"><a href="#"><img src="img/logo.png" alt="logo"></a></div>
            <div class="col-md-offset-6 col-md-5">
              <div class="header__nav">
                <div class="header__nav-search">
                  <input type="text" placeholder="search website"><a class="header__nav-search-btn" href="#"><img src="img/fa_search.png" alt="search-logo"></a>
                  </div><a class="header__nav-buy" href="#">buy $21</a><a class="bars" href="#"><img src="img/fa_bars.png" alt="bars"></a>
              </div>
            </div>
          </div>
        </div>
      </div>
    </header>

As you can see, for example, in the header_nav-search section, not everywhere there is a transition to the next line.
This does not bother me at all, because in the course of writing I only look at pug, the question is, how do customers feel about this? Do they require "slenderness" of html code?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yarkov, 2017-03-13
@patrickj

Well, I'll put in my 5 kopecks)))
gulp-html-prettify is what you need, since it bothers you.

Z
zooks, 2017-03-13
@zooks

What Pug gives out is normal code formatting that both customers and backenders will like.
And personally, I would recommend you to use indents of two spaces - it's more convenient to work with Pug and Sass code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question