伪代码 - 示例

来源于:jade

伪代码: 一般用来模拟真实代码的一种简写方式

伪代码:

 1 !!! 5
 2 html(lang="en")
 3   head
 4     title= pageTitle
 5     :javascript
 6       | if (foo) {
 7       |    bar()
 8       | }
 9   body
10     h1 Jade - node template engine
11     #container
12       - if (youAreUsingJade)
13          You are amazing
14       - else
15          Get on it!
16          Get on it!
17          Get on it!
18          Get on it!

真实代码:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Jade</title>
    <script type="text/javascript">
      //<![CDATA[
      if (foo) {
          bar()
      }
      //]]>
    </script>
  </head>
  <body>
    <h1>Jade - node template engine</h1>
    <div id="container">
      <p>You are amazing</p>
    </div>
  </body>
</html>    

猜你喜欢

转载自www.cnblogs.com/cisum/p/9435859.html