File: template.rbi

package info (click to toggle)
nqp 2024.09%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,972 kB
  • sloc: java: 28,087; perl: 3,479; ansic: 451; makefile: 202; javascript: 68; sh: 1
file content (31 lines) | stat: -rw-r--r-- 1,092 bytes parent folder | download | duplicates (6)
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
# eRubyish templating - see http://en.wikipedia.org/wiki/ERuby
# There are only three directives:
# <?rbi?>    - Header; remainder of the source file is the template body
# <% ... %> - rubyish statements
# #{ ... }  - inserted content

# Any arbritrary code can appear before the template. Output to stdout
# is appended to the template, both before and within the template body

puts %q{<?xml version='1.0' encoding='utf-8'?>}

<?rbi?>
<html>
    <body>
        <h1>Green Bottles...</h1>
        <%n = 10      %>
        <%while n > 0 %>
            <blockquote>
                <em>#{n}</em> green bottles standing on the wall,
                <em>#{n}</em> green bottles standing on the wall
                <br/>
                <%# -- gratuitous use of puts ------------------------------ %>
                <%puts %q{and if one green bottle should accidently fall...} %>
                <br/>
                <%n -= 1 %>
                there'd be <em> #{if n then n else 'no' end} </em> green bottles standing on the wall
            </blockquote>
        <%end%>
    </body>
</html>