インストール

# dnf install npm
# npm install jade --global

JadeからHTMLに変換

$ jade --pretty < index.jade > index.html

記法

HTMLで書いた。

<!DOCTYPE html>
<html lang="ja">

<head>
  <title>Jade</title>
  <script type="text/javascript">
    (function () {
      console.log('Hello, world.');
    })();
  </script>
</head>

<body>
  <h1>Jade - NODE TEMPLATE ENGINE</h1>
  <div class="col" id="container">
    <p>Hello</p>
    <p>
      Jade is a terse and simple
      templating language with a
      strong focus on performance
      and powerful features.
    </p>
  </div>
</body>

</html>

Jadeで書いた。

doctype html
html(lang='ja')
  head
    title Jade
    script(type='text/javascript').
      (function () {
      console.log('Hello, world.');
      })();
  body
    h1 Jade - NODE TEMPLATE ENGINE
    #container.col
      p Hello
      p
        | Jade is a terse and simple
        | templating language with a
        | strong focus on performance
        | and powerful features.

HTMLをJadeに変換したい

  • https://html2jade.org/