zpt
Version:
Zenon Page Templates - JS (ZPT-JS)
64 lines (58 loc) • 2.81 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>ZPT-JS reference - Arithmethic expressions</title>
<script type="module" src="../js/zpt.js"></script>
<script type="text/javascript" src="../lib/syntaxHighlighter/lib.js"></script>
<link rel="stylesheet" type="text/css" href="../docs.css">
<link rel="stylesheet" type="text/css" href="../lib/syntaxHighlighter/theme.css">
</head>
<body>
<div data-use-macro="'page@templates.html'">
<div data-fill-slot="'page-header'">
<h1>ZPT-JS reference - Arithmethic expressions</h1>
<ul>
<li><a href="#syntax">Syntax</a>.</li>
<li><a href="#description">Description</a>.</li>
<li><a href="#differences">Differences with ZPT</a>.</li>
<li><a href="#examples">Examples</a>.</li>
</ul>
</div>
<article data-fill-slot="'article'">
<h2 data-attributes="id 'syntax'">Syntax</h2>
<pre class="syntax">
arithmethic_expressions ::= ( '+:' | '-:' | '*:' | '/:' | '%:' ) expression expression [ expression ]*
</pre>
<h2 data-attributes="id 'description'">Description</h2>
<p>
Some math operations can be done using <em>arithmethic expressions</em>:
</p>
<ul>
<li><code>+: x y</code> -> add x and y</li>
<li><code>-: x y</code> -> subtract y from x</li>
<li><code>*: x y</code> -> multiply x and y</li>
<li><code>/: x y</code> -> divide x by y</li>
<li><code>%: x y</code> -> x mod y</li>
</ul>
<p>
You can use more than 2 values to operate. Parenthesis can be used.
</p>
<h2 data-attributes="id 'differences'">Differences with ZPT</h2>
<p>
This expressions does not exist in ZPT.
</p>
<h2 data-attributes="id 'examples'">Examples</h2>
<p>
Some examples in <em>data-content</em>:
</p>
<pre class="brush: html">
<div data-content="-: assets liabilities">using vars</div>
<div data-content="*: 2 children">using a literal and a var</div>
<div data-content="+: 1 number1 number2">using more than 2 values</div>
<div data-content="+: 1 ( *: number1 number2 )">using parenthesis</div>
</pre>
</article>
</div>
</body>
</html>