S
S
Sergey Goryachev2017-03-23 10:03:25
Node.js
Sergey Goryachev, 2017-03-23 10:03:25

Is it possible to somehow configure / finish jade so that autocomments are written?

I have such a habit - to comment on the code.
Now I'm trying to switch to jade / pug, but I constantly put // comments.
Is there any possibility of automatic commenting in the output file?
I usually put comments on separate BEM blocks.
For example, in jade/pug I write:
div.header
and in the output file I want to get:

<!-- header -->
<div class="header"></div>
<!-- /header -->

I know about this design.
//header
div.header
///header

but is there any way to simplify?
The comment is always equal to the name of the div.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mrSand, 2017-09-11
@mrSand

maybe so

mixin MyBEM(param)
  != '<!-- ' + param + ' -->'
  div(class=param)
  != '<!-- /' + param + ' -->'

but this is a complete perversion)))
can then go through some macro in the editor?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question