Stephen Seo
8da223461d
Implemented "IF", "ELSEIF", "ELSE", "ENDIF", and "INDEX" for templates. IF is used like: `{{{!IF Variable==SomeString}}}`. ELSEIF is used like: `{{{!ELSEIF Variable==AnotherString}}}`. ELSE is used like: `{{{!ELSE}}}`. ENDIF is used like: `{{{!ENDIF}}}`. INDEX is used like: `{{{!INDEX ArrayVar[2]}}}`.
96 lines
1.4 KiB
Text
96 lines
1.4 KiB
Text
PATH=/
|
|
HTML='''
|
|
<html>
|
|
<head>
|
|
<style>
|
|
body {
|
|
color: #FFF;
|
|
background-color: #333;
|
|
}
|
|
a {
|
|
color: #AAF;
|
|
}
|
|
a:link {
|
|
color: #AAF;
|
|
}
|
|
a:visited {
|
|
color: #88B;
|
|
}
|
|
a:focus a:hover {
|
|
color: #DDF;
|
|
}
|
|
a:active {
|
|
color: #FFF;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Test HTML</h1><br>
|
|
<h2>{{{Var}}}</h2>
|
|
<h3><a href="/inner">To inner.</a></h3>
|
|
<h4>Tests:</h4><br>
|
|
{{{!IF ThisValue==false}}}
|
|
ThisValue is <b>false</b>.
|
|
{{{!ELSEIF ThisValue==true}}}
|
|
ThisValue is <b>true</b>.
|
|
{{{!ELSE}}}
|
|
ThisValue is invalid.
|
|
{{{!ENDIF}}}
|
|
|
|
<h4>Array Value:</h4><br>
|
|
{{{!INDEX ArrayValue[2]}}}
|
|
{{{!INDEX ArrayValue[0]}}}
|
|
{{{!INDEX ArrayValue[1]}}}
|
|
</body>
|
|
'''
|
|
|
|
Var='''Test var value'''
|
|
ThisValue=derp
|
|
|
|
ArrayValue=One_IDX_Zero
|
|
ArrayValue=Two_IDX_One
|
|
ArrayValue=Three_IDX_Two
|
|
|
|
PATH=/inner
|
|
HTML_FILE='''example_config/inner.html'''
|
|
VAR_FILE='''example_config/var.html'''
|
|
|
|
PATH=/error
|
|
|
|
PATH=/inner/further
|
|
HTML='''
|
|
<html>
|
|
<head>
|
|
<style>
|
|
body {
|
|
color: #FFF;
|
|
background-color: #333;
|
|
}
|
|
a {
|
|
color: #AAF;
|
|
}
|
|
a:link {
|
|
color: #AAF;
|
|
}
|
|
a:visited {
|
|
color: #88B;
|
|
}
|
|
a:focus a:hover {
|
|
color: #DDF;
|
|
}
|
|
a:active {
|
|
color: #FFF;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Nested inner: further<h1>
|
|
{{{VAR}}}
|
|
<br>
|
|
<img src="/silly.jpg" />
|
|
<br>
|
|
<a href="/inner">back</a>
|
|
</body>
|
|
</html>
|
|
'''
|
|
VAR='''yep'''
|