43 lines
23 KiB
HTML
43 lines
23 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.7-SNAPSHOT</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"><div class="markdown"><p>Application Description Language - generate Selmer templates for the HTML pages implied by an ADL file.</p>
|
||
</div></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"><div class="markdown"><p>*<em>TODO</em>: write docs</p>
|
||
</div></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"><div class="markdown"><p>Generate a retrograde primary navigation link with this <code>content</code> to this <code>url</code>, indicating a backward move through the appliication.</p>
|
||
</div></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"><div class="markdown"><p>Generate a primary navigation link with this <code>content</code> to this <code>url</code>. TODO: should be renamed. <code>primary-link</code> would be better.</p>
|
||
</div></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"><div class="markdown"><p>Compose an auxiliary list from this <code>auxlist</code> specification of dependent records (i.e. the far side of a one-to-many link) of the record of this <code>entity</code> within this <code>application</code> being edited in this <code>form</code></p>
|
||
</div></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"><div class="markdown"><p>Generate all auxiliary lists required for this <code>form</code> of this <code>entity</code> within this <code>application</code>.</p>
|
||
</div></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"><div class="markdown"><p>Compose the content for this <code>form</code> of this <code>entity</code> within this <code>application</code>.</p>
|
||
</div></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"><div class="markdown"><p>Compose any extra-head declarations (i.e. special Javascript tags) required for this <code>form</code> of this <code>entity</code> within this <code>application</code>.</p>
|
||
</div></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"><div class="markdown"><p>Compose any extra-tail declarations (i.e. special Javascript tags) required for this <code>form</code> of this <code>entity</code> within this <code>application</code>.</p>
|
||
</div></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"><div class="markdown"><p>Generate an appropriate <code>ifmemberof</code> tag (see <code>adl-support.tags</code>) given this <code>privilege</code> for the ADL elements listed in <code>elts</code>, which may be fields, properties, list, forms, pages or entities.</p>
|
||
</div></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"><div class="markdown"><p>Generate an input widget for this <code>field-or-property</code> of this <code>form</code> for this <code>entity</code> taken from within this <code>application</code>, in context of a para also containing its label.</p>
|
||
</div></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"><div class="markdown"><p>Compose a list search widget for this <code>field</code> referencing a property within this <code>entity</code>.</p>
|
||
</div></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"><div class="markdown"><p>Compose content to emit if the user is not authorised to write, or not authorised to read, property <code>p</code> in form, list or page <code>f</code> of entity <code>e</code> within application <code>a</code>, while generating a widget with id <code>w</code>.</p>
|
||
</div></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"><div class="markdown"><p>Compose a widget paragraph for property <code>p</code> in form, list or page <code>f</code> of entity <code>e</code> within application <code>a</code>, with id <code>w</code> and this <code>content</code>.</p>
|
||
</div></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"><div class="markdown"><p>For the present, just return the standard cross site scripting protection field statement</p>
|
||
</div></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"><div class="markdown"><p>Return an appropriate ‘save’ widget for this <code>form</code> operating on this <code>entity</code> taken from this <code>application</code>.</p>
|
||
</div></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"><div class="markdown"><p>*<em>TODO</em>: write docs</p>
|
||
</div></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"><div class="markdown"><p>Return the content of the file at <code>resource-path</code>, with these <code>substitutions</code> made into it in order. Substitutions should be pairs <a href="`pattern` `value`"><code>pattern</code> <code>value</code></a>, where <code>pattern</code> is a string, a char, or a regular expression.</p>
|
||
</div></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"><div class="markdown"><p>*<em>TODO</em>: write docs</p>
|
||
</div></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"><div class="markdown"><p>*<em>TODO</em>: write docs</p>
|
||
</div></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"><div class="markdown"><p>*<em>TODO</em>: write docs</p>
|
||
</div></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"><div class="markdown"><p>Generate one or more templates for editing instances of this <code>entity</code> in this <code>application</code></p>
|
||
</div></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"><div class="markdown"><p>Generate a footer for a template file with this <code>filename</code> for this <code>spec</code> of this <code>entity</code> within this <code>application</code>.</p>
|
||
</div></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"><div class="markdown"><p>Generate a header for a template file with this <code>filename</code> for this <code>spec</code> of this <code>entity</code> within this <code>application</code>.</p>
|
||
</div></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"><div class="markdown"><p>Generate a template as specified by this <code>form</code> element for this <code>entity</code>, taken from this <code>application</code>. If <code>form</code> is nill, generate a default form template for the entity.</p>
|
||
</div></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"><div class="markdown"><p>Produce template code to get options for this <code>property</code> of this <code>entity</code> taken from this <code>application</code>.</p>
|
||
</div></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"><div class="markdown"><p>Return, as an integer, the fieldwidth for the input widget for this <code>property</code>.</p>
|
||
</div></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"><div class="markdown"><p>Return a table body element for the list view for this <code>list-spec</code> of this <code>entity</code> within this <code>application</code>, using data from this <code>source</code>.</p>
|
||
</div></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"><div class="markdown"><p>Generate a template as specified by this <code>list</code> element for this <code>entity</code>, taken from this <code>application</code>. If <code>list</code> is nill, generate a default list template for the entity.</p>
|
||
</div></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"><div class="markdown"><p>Generate a template as specified by this <code>page</code> element for this <code>entity</code>, taken from this <code>application</code>. If <code>page</code> is nil, generate a default page template for the entity.</p>
|
||
<p>TODO: not yet written.</p>
|
||
</div></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"><div class="markdown"><p>Return an appropriate ‘save’ widget for this <code>form</code> operating on this <code>entity</code> taken from this <code>application</code>. TODO: should be suppressed unless a member of a group which can insert or edit.</p>
|
||
</div></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"><div class="markdown"><p>*<em>TODO</em>: write docs</p>
|
||
</div></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"><div class="markdown"><p>Return the property on which we will by default do a user search on this <code>entity</code>.</p>
|
||
</div></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"><div class="markdown"><p>Generate an HTML <code>SELECT</code> widget for this <code>property</code> of this <code>entity</code> within this <code>application</code>, to be used in this <code>form</code>. TODO: Many selectable things are potentially too numerous to be simply represented in a simple static SELECT, it needs some asynchronous fetching. See <a href="https://github.com/simon-brooke/youyesyet/issues/47">issue 47</a>.</p>
|
||
</div></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"><div class="markdown"><p>Generate all <a href="https://github.com/yogthos/Selmer">Selmer</a> templates implied by this ADL <code>application</code> spec.</p>
|
||
</div></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"><div class="markdown"><p>Generate a widget for this <code>field-or-property</code> of this <code>form</code> for this <code>entity</code> taken from within this <code>application</code>, in context of a para also containing its label.</p>
|
||
</div></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"><div class="markdown"><p>Return an appropriate HTML5 input type for this property.</p>
|
||
</div></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"><div class="markdown"><p>Wrap this <code>content</code> in an if-member-of tag; if <code>writeable?</code> is true, allow those groups by whom it is writeable, else those by whom it is readable. <code>context</code> should be a sequence of adl elements from which permissions may be obtained.</p>
|
||
</div></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"><div class="markdown"><p>Write a template file with this <code>filename</code> from this <code>template</code> in the context of this <code>application</code>.</p>
|
||
</div></div></div></div></body></html> |