File: test.hero

package info (click to toggle)
web-mode 17.3.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,164 kB
  • sloc: lisp: 13,359; javascript: 506; jsp: 113; sh: 10; php: 9; makefile: 8; xml: 2
file content (58 lines) | stat: -rw-r--r-- 810 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<%!
import (
  "fmt"
  "strings"
)

var a int

const b = "hello, world"

func Add(a, b int) int {
  return a + b
}

type S struct {
  Name string
}
%>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <div>
      <%: func define %>
      <%~ "parent template" %>
      <%+ "sub template" %>
      <%! go code %>
    </div>
    <%@ body { %>
      <span>hello here</span>
    <% } %>
    <div>
      <%== "hello" %>
      <%==i 34  %>
      <%==u Add(a, b) %>
      <%==s user.Name %>
    </div>
    <div>
      <% for _, user := userList { %>
        <% if user != "Alice" { %>
          <%= user %>
        <% } %>
      <% } %>
    </div>
    <div>
      <%
      a, b := 1, 2
      c := Add(a, b)
      %>
    </div>
    <div>
      <%# note %>
    </div>
  </body>
</html>