57 lines
22 KiB
HTML
57 lines
22 KiB
HTML
<!DOCTYPE html PUBLIC ""
|
|
"">
|
|
<html><head><meta charset="UTF-8" /><title>adl.to-selmer-templates documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.6</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-selmer-templates.html#var-application-to-template"><div class="inner"><span>application-to-template</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-back-link"><div class="inner"><span>back-link</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-big-link"><div class="inner"><span>big-link</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-form-auxlist"><div class="inner"><span>compose-form-auxlist</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-form-auxlists"><div class="inner"><span>compose-form-auxlists</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-form-content"><div class="inner"><span>compose-form-content</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-form-extra-head"><div class="inner"><span>compose-form-extra-head</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-form-extra-tail"><div class="inner"><span>compose-form-extra-tail</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-if-member-of-tag"><div class="inner"><span>compose-if-member-of-tag</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-input-widget-para"><div class="inner"><span>compose-input-widget-para</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-list-search-widget"><div class="inner"><span>compose-list-search-widget</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-readable-or-not-authorised"><div class="inner"><span>compose-readable-or-not-authorised</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-compose-widget-para"><div class="inner"><span>compose-widget-para</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-csrf-widget"><div class="inner"><span>csrf-widget</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-delete-widget"><div class="inner"><span>delete-widget</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-edit-link"><div class="inner"><span>edit-link</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-embed-script-fragment"><div class="inner"><span>embed-script-fragment</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-emit-content"><div class="inner"><span>emit-content</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-emit-entity-dd"><div class="inner"><span>emit-entity-dd</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-emit-entity-dt"><div class="inner"><span>emit-entity-dt</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-entity-to-templates"><div class="inner"><span>entity-to-templates</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-file-footer"><div class="inner"><span>file-footer</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-file-header"><div class="inner"><span>file-header</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-form-to-template"><div class="inner"><span>form-to-template</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-get-options"><div class="inner"><span>get-options</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-get-size-for-widget"><div class="inner"><span>get-size-for-widget</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-list-tbody"><div class="inner"><span>list-tbody</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-list-to-template"><div class="inner"><span>list-to-template</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-page-to-template"><div class="inner"><span>page-to-template</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-save-widget"><div class="inner"><span>save-widget</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-select-field-name"><div class="inner"><span>select-field-name</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-select-property"><div class="inner"><span>select-property</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-select-widget"><div class="inner"><span>select-widget</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-to-selmer-templates"><div class="inner"><span>to-selmer-templates</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-widget"><div class="inner"><span>widget</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-widget-type"><div class="inner"><span>widget-type</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-wrap-in-if-member-of"><div class="inner"><span>wrap-in-if-member-of</span></div></a></li><li class="depth-1"><a href="adl.to-selmer-templates.html#var-write-template-file"><div class="inner"><span>write-template-file</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-selmer-templates</h1><div class="doc"><pre class="plaintext">Application Description Language - generate Selmer templates for
|
|
the HTML pages implied by an ADL file.</pre></div><div class="public anchor" id="var-application-to-template"><h3>application-to-template</h3><div class="usage"><code>(application-to-template application)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-back-link"><h3>back-link</h3><div class="usage"><code>(back-link content url)</code></div><div class="doc"><pre class="plaintext">Generate a retrograde primary navigation link with this `content` to this
|
|
`url`, indicating a backward move through the appliication.</pre></div></div><div class="public anchor" id="var-big-link"><h3>big-link</h3><div class="usage"><code>(big-link content url)</code></div><div class="doc"><pre class="plaintext">Generate a primary navigation link with this `content` to this `url`.
|
|
TODO: should be renamed. `primary-link` would be better.</pre></div></div><div class="public anchor" id="var-compose-form-auxlist"><h3>compose-form-auxlist</h3><div class="usage"><code>(compose-form-auxlist auxlist form entity application)</code></div><div class="doc"><pre class="plaintext">Compose an auxiliary list from this `auxlist` specification of dependent
|
|
records (i.e. the far side of a
|
|
one-to-many link) of the record of this `entity` within this `application`
|
|
being edited in this `form` </pre></div></div><div class="public anchor" id="var-compose-form-auxlists"><h3>compose-form-auxlists</h3><div class="usage"><code>(compose-form-auxlists form entity application)</code></div><div class="doc"><pre class="plaintext">Generate all auxiliary lists required for this `form` of this `entity`
|
|
within this `application`.</pre></div></div><div class="public anchor" id="var-compose-form-content"><h3>compose-form-content</h3><div class="usage"><code>(compose-form-content form entity application)</code></div><div class="doc"><pre class="plaintext">Compose the content for this `form` of this `entity` within this `application`.
|
|
</pre></div></div><div class="public anchor" id="var-compose-form-extra-head"><h3>compose-form-extra-head</h3><div class="usage"><code>(compose-form-extra-head form entity application)</code></div><div class="doc"><pre class="plaintext">Compose any extra-head declarations (i.e. special Javascript tags) required
|
|
for this `form` of this `entity` within this `application`.</pre></div></div><div class="public anchor" id="var-compose-form-extra-tail"><h3>compose-form-extra-tail</h3><div class="usage"><code>(compose-form-extra-tail form entity application)</code></div><div class="doc"><pre class="plaintext">Compose any extra-tail declarations (i.e. special Javascript tags) required
|
|
for this `form` of this `entity` within this `application`.</pre></div></div><div class="public anchor" id="var-compose-if-member-of-tag"><h3>compose-if-member-of-tag</h3><div class="usage"><code>(compose-if-member-of-tag privilege & elts)</code></div><div class="doc"><pre class="plaintext">Generate an appropriate `ifmemberof` tag (see `adl-support.tags`) given this
|
|
`privilege` for the ADL elements listed in `elts`, which may be fields,
|
|
properties, list, forms, pages or entities.</pre></div></div><div class="public anchor" id="var-compose-input-widget-para"><h3>compose-input-widget-para</h3><div class="usage"><code>(compose-input-widget-para property form entity application widget-name)</code></div><div class="doc"><pre class="plaintext">Generate an input widget for this `field-or-property` of this `form` for
|
|
this `entity` taken from within this `application`, in context of a para
|
|
also containing its label.</pre></div></div><div class="public anchor" id="var-compose-list-search-widget"><h3>compose-list-search-widget</h3><div class="usage"><code>(compose-list-search-widget field entity)</code></div><div class="doc"><pre class="plaintext">Compose a list search widget for this `field` referencing a property within
|
|
this `entity`.</pre></div></div><div class="public anchor" id="var-compose-readable-or-not-authorised"><h3>compose-readable-or-not-authorised</h3><div class="usage"><code>(compose-readable-or-not-authorised p f e a w)</code></div><div class="doc"><pre class="plaintext">Compose content to emit if the user is not authorised to write, or
|
|
not authorised to read, property `p` in form, list or page `f` of
|
|
entity `e` within application `a`, while generating a widget with id
|
|
`w`.</pre></div></div><div class="public anchor" id="var-compose-widget-para"><h3>compose-widget-para</h3><div class="usage"><code>(compose-widget-para p f e a w content)</code></div><div class="doc"><pre class="plaintext">Compose a widget paragraph for property `p` in form, list or page `f` of
|
|
entity `e` within application `a`, with id `w` and this `content`.</pre></div></div><div class="public anchor" id="var-csrf-widget"><h3>csrf-widget</h3><div class="usage"><code>(csrf-widget)</code></div><div class="doc"><pre class="plaintext">For the present, just return the standard cross site scripting protection
|
|
field statement</pre></div></div><div class="public anchor" id="var-delete-widget"><h3>delete-widget</h3><div class="usage"><code>(delete-widget form entity application)</code></div><div class="doc"><pre class="plaintext">Return an appropriate 'save' widget for this `form` operating on this
|
|
`entity` taken from this `application`.</pre></div></div><div class="public anchor" id="var-edit-link"><h3>edit-link</h3><div class="usage"><code>(edit-link source entity application parameters)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-embed-script-fragment"><h3>embed-script-fragment</h3><div class="usage"><code>(embed-script-fragment resource-path substitutions)</code><code>(embed-script-fragment resource-path)</code></div><div class="doc"><pre class="plaintext">Return the content of the file at `resource-path`, with these
|
|
`substitutions` made into it in order. Substitutions should be pairs
|
|
[`pattern` `value`], where `pattern` is a string, a char, or a regular
|
|
expression.</pre></div></div><div class="public anchor" id="var-emit-content"><h3>emit-content</h3><div class="usage"><code>(emit-content content)</code><code>(emit-content filename application k)</code><code>(emit-content filename spec entity application k)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-emit-entity-dd"><h3>emit-entity-dd</h3><div class="usage"><code>(emit-entity-dd entity application)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-emit-entity-dt"><h3>emit-entity-dt</h3><div class="usage"><code>(emit-entity-dt entity application)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-entity-to-templates"><h3>entity-to-templates</h3><div class="usage"><code>(entity-to-templates entity application)</code></div><div class="doc"><pre class="plaintext">Generate one or more templates for editing instances of this
|
|
`entity` in this `application`</pre></div></div><div class="public anchor" id="var-file-footer"><h3>file-footer</h3><div class="usage"><code>(file-footer filename application)</code><code>(file-footer filename spec entity application)</code></div><div class="doc"><pre class="plaintext">Generate a footer for a template file with this `filename` for this `spec`
|
|
of this `entity` within this `application`.</pre></div></div><div class="public anchor" id="var-file-header"><h3>file-header</h3><div class="usage"><code>(file-header filename application)</code><code>(file-header filename spec entity application)</code></div><div class="doc"><pre class="plaintext">Generate a header for a template file with this `filename` for this `spec`
|
|
of this `entity` within this `application`.</pre></div></div><div class="public anchor" id="var-form-to-template"><h3>form-to-template</h3><div class="usage"><code>(form-to-template form entity application)</code></div><div class="doc"><pre class="plaintext">Generate a template as specified by this `form` element for this `entity`,
|
|
taken from this `application`. If `form` is nill, generate a default form
|
|
template for the entity.</pre></div></div><div class="public anchor" id="var-get-options"><h3>get-options</h3><div class="usage"><code>(get-options property form entity application)</code></div><div class="doc"><pre class="plaintext">Produce template code to get options for this `property` of this `entity`
|
|
taken from this `application`.</pre></div></div><div class="public anchor" id="var-get-size-for-widget"><h3>get-size-for-widget</h3><div class="usage"><code>(get-size-for-widget property)</code></div><div class="doc"><pre class="plaintext">Return, as an integer, the fieldwidth for the input widget for this
|
|
`property`.</pre></div></div><div class="public anchor" id="var-list-tbody"><h3>list-tbody</h3><div class="usage"><code>(list-tbody source list-spec entity application)</code></div><div class="doc"><pre class="plaintext">Return a table body element for the list view for this `list-spec` of
|
|
this `entity` within this `application`, using data from this `source`.</pre></div></div><div class="public anchor" id="var-list-to-template"><h3>list-to-template</h3><div class="usage"><code>(list-to-template list-spec entity application)</code></div><div class="doc"><pre class="plaintext">Generate a template as specified by this `list` element for this `entity`,
|
|
taken from this `application`. If `list` is nill, generate a default list
|
|
template for the entity.</pre></div></div><div class="public anchor" id="var-page-to-template"><h3>page-to-template</h3><div class="usage"><code>(page-to-template page entity application)</code></div><div class="doc"><pre class="plaintext">Generate a template as specified by this `page` element for this `entity`,
|
|
taken from this `application`. If `page` is nil, generate a default page
|
|
template for the entity.
|
|
|
|
TODO: not yet written.</pre></div></div><div class="public anchor" id="var-save-widget"><h3>save-widget</h3><div class="usage"><code>(save-widget form entity application)</code></div><div class="doc"><pre class="plaintext">Return an appropriate 'save' widget for this `form` operating on this
|
|
`entity` taken from this `application`.
|
|
TODO: should be suppressed unless a member of a group which can insert
|
|
or edit.</pre></div></div><div class="public anchor" id="var-select-field-name"><h3>select-field-name</h3><div class="usage"><code>(select-field-name entity)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-select-property"><h3>select-property</h3><div class="usage"><code>(select-property entity)</code></div><div class="doc"><pre class="plaintext">Return the property on which we will by default do a user search on this
|
|
`entity`.</pre></div></div><div class="public anchor" id="var-select-widget"><h3>select-widget</h3><div class="usage"><code>(select-widget property form entity application)</code></div><div class="doc"><pre class="plaintext">Generate an HTML `SELECT` widget for this `property` of this `entity` within
|
|
this `application`, to be used in this `form`. TODO: Many selectable things
|
|
are potentially too numerous to be simply represented in a simple static
|
|
SELECT, it needs some asynchronous fetching. See
|
|
[issue 47](<a href="https://github.com/simon-brooke/youyesyet/issues/47)">https://github.com/simon-brooke/youyesyet/issues/47)</a>.</pre></div></div><div class="public anchor" id="var-to-selmer-templates"><h3>to-selmer-templates</h3><div class="usage"><code>(to-selmer-templates application)</code></div><div class="doc"><pre class="plaintext">Generate all [Selmer](<a href="https://github.com/yogthos/Selmer)">https://github.com/yogthos/Selmer)</a> templates implied
|
|
by this ADL `application` spec.</pre></div></div><div class="public anchor" id="var-widget"><h3>widget</h3><div class="usage"><code>(widget field-or-property form entity application)</code></div><div class="doc"><pre class="plaintext">Generate a widget for this `field-or-property` of this `form` for this
|
|
`entity` taken from within this `application`, in context of a para also
|
|
containing its label.</pre></div></div><div class="public anchor" id="var-widget-type"><h3>widget-type</h3><div class="usage"><code>(widget-type property application)</code><code>(widget-type property application typedef)</code></div><div class="doc"><pre class="plaintext">Return an appropriate HTML5 input type for this property.
|
|
</pre></div></div><div class="public anchor" id="var-wrap-in-if-member-of"><h3>wrap-in-if-member-of</h3><div class="usage"><code>(wrap-in-if-member-of content privilege & context)</code></div><div class="doc"><pre class="plaintext">Wrap this `content` in an if-member-of tag; if `writeable?` is true,
|
|
allow those groups by whom it is writeable, else those by whom it is
|
|
readable. `context` should be a sequence of adl elements from which
|
|
permissions may be obtained.</pre></div></div><div class="public anchor" id="var-write-template-file"><h3>write-template-file</h3><div class="usage"><code>(write-template-file filename template application)</code></div><div class="doc"><pre class="plaintext">Write a template file with this `filename` from this `template` in the
|
|
context of this `application`.</pre></div></div></div></body></html> |