Fix: merge conflict
[myslice.git] / to-be-integrated / third-party / codemirror-3.15 / mode / velocity / index.html
1 <!doctype html>
2 <html>
3   <head>
4     <meta charset="utf-8">
5     <title>CodeMirror: Velocity mode</title>
6     <link rel="stylesheet" href="../../lib/codemirror.css">
7     <script src="../../lib/codemirror.js"></script>
8     <script src="velocity.js"></script>
9     <link rel="stylesheet" href="../../theme/night.css">
10     <style>.CodeMirror {border: 1px solid black;}</style>
11     <link rel="stylesheet" href="../../doc/docs.css">
12   </head>
13   <body>
14     <h1>CodeMirror: Velocity mode</h1>
15     <form><textarea id="code" name="code">
16 ## Velocity Code Demo
17 #*
18    based on PL/SQL mode by Peter Raganitsch, adapted to Velocity by Steve O'Hara ( http://www.pivotal-solutions.co.uk )
19    August 2011
20 *#
21
22 #*
23    This is a multiline comment.
24    This is the second line
25 *#
26
27 #[[ hello steve
28    This has invalid syntax that would normally need "poor man's escaping" like:
29
30    #define()
31
32    ${blah
33 ]]#
34
35 #include( "disclaimer.txt" "opinion.txt" )
36 #include( $foo $bar )
37
38 #parse( "lecorbusier.vm" )
39 #parse( $foo )
40
41 #evaluate( 'string with VTL #if(true)will be displayed#end' )
42
43 #define( $hello ) Hello $who #end #set( $who = "World!") $hello ## displays Hello World!
44
45 #foreach( $customer in $customerList )
46
47     $foreach.count $customer.Name
48
49     #if( $foo == ${bar})
50         it's true!
51         #break
52     #{else}
53         it's not!
54         #stop
55     #end
56
57     #if ($foreach.parent.hasNext)
58         $velocityCount
59     #end
60 #end
61
62 $someObject.getValues("this is a string split
63         across lines")
64
65 #macro( tablerows $color $somelist )
66     #foreach( $something in $somelist )
67         <tr><td bgcolor=$color>$something</td></tr>
68     #end
69 #end
70
71 #tablerows("red" ["dadsdf","dsa"])
72
73    Variable reference: #set( $monkey = $bill )
74    String literal: #set( $monkey.Friend = 'monica' )
75    Property reference: #set( $monkey.Blame = $whitehouse.Leak )
76    Method reference: #set( $monkey.Plan = $spindoctor.weave($web) )
77    Number literal: #set( $monkey.Number = 123 )
78    Range operator: #set( $monkey.Numbers = [1..3] )
79    Object list: #set( $monkey.Say = ["Not", $my, "fault"] )
80    Object map: #set( $monkey.Map = {"banana" : "good", "roast beef" : "bad"})
81
82 The RHS can also be a simple arithmetic expression, such as:
83 Addition: #set( $value = $foo + 1 )
84    Subtraction: #set( $value = $bar - 1 )
85    Multiplication: #set( $value = $foo * $bar )
86    Division: #set( $value = $foo / $bar )
87    Remainder: #set( $value = $foo % $bar )
88
89 </textarea></form>
90     <script>
91       var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
92         tabMode: "indent",
93         theme: "night",
94         lineNumbers: true,
95         indentUnit: 4,
96         mode: "text/velocity"
97       });
98     </script>
99
100     <p><strong>MIME types defined:</strong> <code>text/velocity</code>.</p>
101
102   </body>
103 </html>