root/livinglogic.googleappengine.ul4/index.html @ 14:1054f15cf78a

Revision 14:1054f15cf78a, 4.3 KB (checked in by Walter Doerwald <walter@…>, 11 years ago)

Add link to the hg repository.

RevLine 
[2]1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[1]2<html>
3<head>
4<title>Universal Layout Language</title>
5<script type="text/javascript" src="static/jquery.js"></script>
6<script type="text/javascript" src="static/jquery.textarearesizer.js"></script>
7<script type="text/javascript" src="static/main.js"></script>
8<script type="text/javascript" language="javascript">$(ready)</script>
9<link rel="stylesheet" href="static/main.css" />
10</head>
11<body>
[2]12<h1>UL4 compiler</h1>
[1]13<div class="panel">
14<form action="/compile" method="post">
[9]15<table class="panel" border="0" cellspacing="0" cellpadding="0">
16<tr><td>
17<div id="source">
[2]18<h2>Source</h2>
19<div><textarea name="source" rows="12" cols="80">&lt;?if data?&gt;
[1]20&lt;ul&gt;
21&lt;?for (i, item) in enumerate(data)?&gt;
22&lt;li&gt;&lt;b&gt;&lt;?printx i?&gt;:&lt;/b&gt; &lt;?printx item?&gt;&lt;/li&gt;
23&lt;?end for?&gt;
24&lt;/ul&gt;
25&lt;?end if?&gt;</textarea></div>
[2]26<div class="desc">
[3]27Enter the source code for your template. (More information about the <a href="http://www.livinglogic.de/Python/ul4/Howto.html">templating language</a>).
[2]28</div>
29</div>
30
[9]31<div id="submit">
32<div><input type="submit" value="&nbsp;&nbsp;Compile!&nbsp;&nbsp;"/></div>
33</div>
34
35<div id="error">
36<h2>Errors</h2>
37<div></div>
38</div>
39
40<div id="output">
41<h2>Output</h2>
42<div><textarea name="output" readonly="readonly" rows="20" cols="80"></textarea></div>
43</div>
44
[10]45</td><td width="38%">
[9]46   
47<div id="delimiters">
[2]48<h2>Delimiters</h2>
49<table class="delimiters" border="0" cellspacing="0" cellpadding="0">
50<tr><th>Start delimiter:&nbsp;</th><td><input name="startdelim" size="8" value="&lt;?" /></td></tr>
51<tr><th>End delimiter:&nbsp;</th><td><input name="enddelim" size="8" value="?&gt;" /></td></tr>
52</table>
53<div class="desc">
[3]54Select which tag delimiters you want to use in the source code (e.g. <code>&lt;?</code> and <code>?&gt;</code> or <code>{{</code> and <code>}}</code>).
[2]55</div>
56</div>
57
[9]58<div id="format">
[2]59<h2>Output format</h2>
[6]60<div><input type="radio" name="format" value="bytecode" checked="checked" /> Bytecode<br />
[10]61<input type="radio" name="format" value="reprbytecode" /> <code>repr()</code> output of bytecode<br />
[6]62<input type="radio" name="format" value="python" /> Python source code</div>
[2]63<div class="desc">
[3]64<p>Select the output format that the compiler should produce:</p>
65<ul>
66<li><em>Bytecode</em> can be saved to a file (UTF-8 must be used as the encoding) and then be loaded via
67<a href="http://www.livinglogic.de/Python/ul4/index.html#Template-load"><code>ll.ul4c.Template.load()</code></a>.</li>
[6]68<li><em><code>repr()</code> output of the bytecode</em> can be apsted directly into a Python source file into a call to
[3]69<a href="http://www.livinglogic.de/Python/ul4/index.html#Template-loads"><code>ll.ul4c.Template.loads()</code></a>.</li>
70<li><em>Python source code</em> produces a Python function <code>template(templates={}, **variables)</code>.</li>
71</ul>
[2]72</div>
73</div>
74
[9]75<div id="webservice">
[14]76<h3>Web service</h3>
[8]77
[14]78<p>You can use this application as a web service. To compile a template post the
79data to the url <code>http://ul4.appspot.com/compile</code>. The following parameter can be passed:</p>
[8]80<dl>
81<dt><code>source</code> (mandatory)</dt>
82<dd>The template source code</dd>
83<dt><code>startdelim</code> (optional)</dt>
84<dd>The start delimiter for tag. It defaults to <code>&lt;?</code> if unspecified.</dd>
85<dt><code>enddelim</code> (optional)</dt>
86<dd>The end delimiter for tag. It defaults to <code>?&gt;</code> if unspecified.</dd>
87<dt><code>format</code> (optional)</dt>
88<dd>Either <code>bytecode</code>, <code>reprbytecode</code> or <code>python</code>. It defaults to <code>bytecode</code> if unspecified.</dd>
89</dl>
[13]90<p>The parameters should be UTF-8 encoded.</p>
[8]91<p>In case of a compiler error the server will return a HTTP status code of 400. The body of the response will contain the error message.</p>
[9]92</div>
93
[14]94<div id="source">
95<h3>Source</h3>
96<p>The source of this application is available from a <a href="http://hg.livinglogic.de/LivingLogic.GoogleAppEngine.ul4/">Mercurial repository</a>.
97To clone this repository install <a href="http://www.selenic.com/mercurial/">Mercurial</a> and enter the following command:</p>
98<pre>
99$ hg clone http://hg.livinglogic.de/LivingLogic.GoogleAppEngine.ul4
100</pre>
101</div>
[9]102
103</td>
104</tr>
105</table>
106
107
108</form>
109
[1]110</body>
111</html>
Note: See TracBrowser for help on using the browser.