Documentation; preparation for beta release.
This commit is contained in:
parent
559b62f5d5
commit
8c4ad97040
|
@ -1,7 +1,10 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
|
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
|
||||||
|
|
||||||
## [Unreleased]
|
## 0.1.4 - 2018-0922
|
||||||
|
|
||||||
|
### Added
|
||||||
|
Mainly documentation and tidy-up; Beta release.
|
||||||
|
|
||||||
## 0.1.0 - 2018-06-17
|
## 0.1.0 - 2018-06-17
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -6,7 +6,7 @@ A Clojure library designed to support auto-generated [ADL](https://github.com/si
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
You don't really use this; code auto-generated by ADL does.
|
You don't really use this; code auto-generated by ADL does. Some functions which may be more generally useful are in `adl-support.core`, q.v.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
28
doc/adl-support.core.html
Normal file
28
doc/adl-support.core.html
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>adl-support.core 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch current"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.core.html#var-*warn*"><div class="inner"><span>*warn*</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-compose-exception-reason"><div class="inner"><span>compose-exception-reason</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-compose-reason-and-log"><div class="inner"><span>compose-reason-and-log</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-log-and-return-reason"><div class="inner"><span>do-or-log-and-return-reason</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-log-error"><div class="inner"><span>do-or-log-error</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-return-reason"><div class="inner"><span>do-or-return-reason</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-warn"><div class="inner"><span>do-or-warn</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-warn-and-log"><div class="inner"><span>do-or-warn-and-log</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-massage-params"><div class="inner"><span>massage-params</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-massage-value"><div class="inner"><span>massage-value</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-raw-massage-params"><div class="inner"><span>raw-massage-params</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-raw-resolve-template"><div class="inner"><span>raw-resolve-template</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-resolve-template"><div class="inner"><span>resolve-template</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.core</h1><div class="doc"><pre class="plaintext">Application Description Language support - utility functions likely
|
||||||
|
to be useful in user-written code.</pre></div><div class="public anchor" id="var-*warn*"><h3>*warn*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><pre class="plaintext">The idea here is to have a function with which to show warnings to the user,
|
||||||
|
which can be dynamically bound. Any binding should be a function of one
|
||||||
|
argument, which it should print, log, or otherwise display.</pre></div></div><div class="public anchor" id="var-compose-exception-reason"><h3>compose-exception-reason</h3><h4 class="type">macro</h4><div class="usage"><code>(compose-exception-reason exception intro)</code><code>(compose-exception-reason exception)</code></div><div class="doc"><pre class="plaintext">Compose and return a sensible reason message for this `exception`.
|
||||||
|
</pre></div></div><div class="public anchor" id="var-compose-reason-and-log"><h3>compose-reason-and-log</h3><h4 class="type">macro</h4><div class="usage"><code>(compose-reason-and-log exception intro)</code><code>(compose-reason-and-log exception)</code></div><div class="doc"><pre class="plaintext">Compose a reason message for this `exception`, log it (with its
|
||||||
|
stacktrace), and return the reason message.</pre></div></div><div class="public anchor" id="var-do-or-log-and-return-reason"><h3>do-or-log-and-return-reason</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-log-and-return-reason form)</code></div><div class="doc"><pre class="plaintext">Clojure stacktraces are unreadable. We have to do better; evaluate
|
||||||
|
this `form` in a try-catch block; return a map. If the evaluation
|
||||||
|
succeeds, the map will have a key `:result` whose value is the result;
|
||||||
|
otherwise it will have a key `:error` which will be bound to the most
|
||||||
|
sensible error message we can construct. Additionally, log the exception</pre></div></div><div class="public anchor" id="var-do-or-log-error"><h3>do-or-log-error</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-log-error form & {:keys [message error-return], :or {message (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/str)) (clojure.core/list "A failure occurred in ") (clojure.core/list (list (quote quote) form))))}})</code></div><div class="doc"><pre class="plaintext">Evaluate the supplied `form` in a try/catch block. If the
|
||||||
|
keyword param `:message` is supplied, the value will be used
|
||||||
|
as the log message; if the keyword param `:error-return` is
|
||||||
|
supplied, the value will be returned if an exception is caught.</pre></div></div><div class="public anchor" id="var-do-or-return-reason"><h3>do-or-return-reason</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-return-reason form intro)</code><code>(do-or-return-reason form)</code></div><div class="doc"><pre class="plaintext">Clojure stacktraces are unreadable. We have to do better; evaluate
|
||||||
|
this `form` in a try-catch block; return a map. If the evaluation
|
||||||
|
succeeds, the map will have a key `:result` whose value is the result;
|
||||||
|
otherwise it will have a key `:error` which will be bound to the most
|
||||||
|
sensible error message we can construct.</pre></div></div><div class="public anchor" id="var-do-or-warn"><h3>do-or-warn</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-warn form)</code><code>(do-or-warn form intro)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form`; if any exception is thrown, show it to the user
|
||||||
|
via the `*warn*` mechanism.</pre></div></div><div class="public anchor" id="var-do-or-warn-and-log"><h3>do-or-warn-and-log</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-warn-and-log form)</code><code>(do-or-warn-and-log form intro)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form`; if any exception is thrown, log the reason and
|
||||||
|
show it to the user via the `*warn*` mechanism.</pre></div></div><div class="public anchor" id="var-massage-params"><h3>massage-params</h3><div class="usage"></div><div class="doc"><pre class="plaintext">Sending empty strings, or numbers as strings, to the database often isn't
|
||||||
|
helpful. Massage these `params` and `form-params` to eliminate these problems.
|
||||||
|
We must take key field values out of just params, but we should take all other
|
||||||
|
values out of form-params - because we need the key to load the form in
|
||||||
|
the first place, but just accepting values of other params would allow spoofing.</pre></div></div><div class="public anchor" id="var-massage-value"><h3>massage-value</h3><div class="usage"><code>(massage-value k m)</code></div><div class="doc"><pre class="plaintext">Return a map with one key, this `k` as a keyword, whose value is the binding of
|
||||||
|
`k` in map `m`, as read by read.</pre></div></div><div class="public anchor" id="var-raw-massage-params"><h3>raw-massage-params</h3><div class="usage"><code>(raw-massage-params request entity)</code><code>(raw-massage-params request)</code></div><div class="doc"><pre class="plaintext">Sending empty strings, or numbers as strings, to the database often isn't
|
||||||
|
helpful. Massage these `params` and `form-params` to eliminate these problems.
|
||||||
|
Date and time fields also need massaging.</pre></div></div><div class="public anchor" id="var-raw-resolve-template"><h3>raw-resolve-template</h3><div class="usage"><code>(raw-resolve-template n)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-resolve-template"><h3>resolve-template</h3><div class="usage"></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div></div></body></html>
|
7
doc/adl-support.filters.html
Normal file
7
doc/adl-support.filters.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>adl-support.filters 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.filters.html#var-*default-international-dialing-prefix*"><div class="inner"><span>*default-international-dialing-prefix*</span></div></a></li><li class="depth-1"><a href="adl-support.filters.html#var-email"><div class="inner"><span>email</span></div></a></li><li class="depth-1"><a href="adl-support.filters.html#var-telephone"><div class="inner"><span>telephone</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.filters</h1><div class="doc"><pre class="plaintext">Application Description Language support - custom Selmer filters
|
||||||
|
used in generated templates.</pre></div><div class="public anchor" id="var-*default-international-dialing-prefix*"><h3>*default-international-dialing-prefix*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><pre class="plaintext">The international dialing prefix to use, if none is specified.
|
||||||
|
</pre></div></div><div class="public anchor" id="var-email"><h3>email</h3><div class="usage"><code>(email arg)</code></div><div class="doc"><pre class="plaintext">If `arg` is, or appears to be, a valid email address, convert it into
|
||||||
|
a `mailto:` link, else leave it be.</pre></div></div><div class="public anchor" id="var-telephone"><h3>telephone</h3><div class="usage"><code>(telephone arg)</code></div><div class="doc"><pre class="plaintext">If `arg` is, or appears to be, a valid telephone number, convert it into
|
||||||
|
a `tel:` link, else leave it be.</pre></div></div></div></body></html>
|
15
doc/adl-support.forms-support.html
Normal file
15
doc/adl-support.forms-support.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>adl-support.forms-support 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.forms-support.html#var-all-keys-present.3F"><div class="inner"><span>all-keys-present?</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-auxlist-data-name"><div class="inner"><span>auxlist-data-name</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-get-current-value"><div class="inner"><span>get-current-value</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-get-menu-options"><div class="inner"><span>get-menu-options</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-prepare-insertion-params"><div class="inner"><span>prepare-insertion-params</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-property-defaults"><div class="inner"><span>property-defaults</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-query-name"><div class="inner"><span>query-name</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.forms-support</h1><div class="doc"><pre class="plaintext">Application Description Language support - functions useful in
|
||||||
|
generating forms.</pre></div><div class="public anchor" id="var-all-keys-present.3F"><h3>all-keys-present?</h3><h4 class="type">macro</h4><div class="usage"><code>(all-keys-present? m keys)</code></div><div class="doc"><pre class="plaintext">Return true if all the keys in `keys` are present in the map `m`.
|
||||||
|
</pre></div></div><div class="public anchor" id="var-auxlist-data-name"><h3>auxlist-data-name</h3><h4 class="type">macro</h4><div class="usage"><code>(auxlist-data-name auxlist)</code></div><div class="doc"><pre class="plaintext">The name to which data for this `auxlist` will be bound in the
|
||||||
|
Selmer params.</pre></div></div><div class="public anchor" id="var-get-current-value"><h3>get-current-value</h3><h4 class="type">macro</h4><div class="usage"><code>(get-current-value f params entity-name)</code></div><div class="doc"><pre class="plaintext">Use the function `f` and these `params` to fetch an `entity` record from the database.
|
||||||
|
</pre></div></div><div class="public anchor" id="var-get-menu-options"><h3>get-menu-options</h3><h4 class="type">macro</h4><div class="usage"><code>(get-menu-options entity-name get-q list-q fk value)</code></div><div class="doc"><pre class="plaintext">Fetch options for a menu of `entity-name` from the database, using this
|
||||||
|
`get-q` query and this `list-q` query, using the key `fk`, where the current
|
||||||
|
value is this `value`.</pre></div></div><div class="public anchor" id="var-prepare-insertion-params"><h3>prepare-insertion-params</h3><h4 class="type">macro</h4><div class="usage"><code>(prepare-insertion-params params fields)</code></div><div class="doc"><pre class="plaintext">Params for insertion into the database must have keys for all fields in the
|
||||||
|
insert query, even if the value of some of those keys is nil. Massage these
|
||||||
|
`params` to have a value for each field in these `fields`.</pre></div></div><div class="public anchor" id="var-property-defaults"><h3>property-defaults</h3><div class="usage"><code>(property-defaults entity)</code></div><div class="doc"><pre class="plaintext">Get a map of property names and default values for all properties of this
|
||||||
|
`entity` which have explicit defaults.</pre></div></div><div class="public anchor" id="var-query-name"><h3>query-name</h3><div class="usage"><code>(query-name entity-or-name q-type)</code></div><div class="doc"><pre class="plaintext">Generate a query name for the query of type `q-type` (expected to be one
|
||||||
|
of `:create`, `:delete`, `:get`, `:list`, `:search-strings`, `:update`) of
|
||||||
|
the entity `entity-or-name` NOTE: if `entity-or-name` is passed as a string,
|
||||||
|
it should be the full, unaltered name of the entity.</pre></div></div></div></body></html>
|
8
doc/adl-support.print-usage.html
Normal file
8
doc/adl-support.print-usage.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>adl-support.print-usage 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.print-usage.html#var-print-usage"><div class="inner"><span>print-usage</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.print-usage</h1><div class="doc"><pre class="plaintext">Application Description Language support - print a usage message.
|
||||||
|
</pre></div><div class="public anchor" id="var-print-usage"><h3>print-usage</h3><div class="usage"><code>(print-usage project-name parsed-options)</code><code>(print-usage project-name parsed-options extra-args)</code></div><div class="doc"><pre class="plaintext">Print a UN*X style usage message. `project-name` should be the base name of
|
||||||
|
the executable jar file you generate, `parsed-options` should be options as
|
||||||
|
parsed by [clojure.tools.cli](<a href="https://github.com/clojure/tools.cli)">https://github.com/clojure/tools.cli)</a>. If
|
||||||
|
`extra-args` is supplied, it should be a map of name, documentation pairs
|
||||||
|
for each additional argument which may be supplied.</pre></div></div></div></body></html>
|
9
doc/adl-support.rest-support.html
Normal file
9
doc/adl-support.rest-support.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>adl-support.rest-support 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.rest-support.html#var-do-or-server-fail"><div class="inner"><span>do-or-server-fail</span></div></a></li><li class="depth-1"><a href="adl-support.rest-support.html#var-if-valid-user"><div class="inner"><span>if-valid-user</span></div></a></li><li class="depth-1"><a href="adl-support.rest-support.html#var-valid-user-or-forbid"><div class="inner"><span>valid-user-or-forbid</span></div></a></li><li class="depth-1"><a href="adl-support.rest-support.html#var-with-params-or-error"><div class="inner"><span>with-params-or-error</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.rest-support</h1><div class="doc"><pre class="plaintext">Application Description Language support - functions useful in
|
||||||
|
generating JSON route handlers.</pre></div><div class="public anchor" id="var-do-or-server-fail"><h3>do-or-server-fail</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-server-fail form status)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form`; if it succeeds, return an HTTP response with this
|
||||||
|
status code and the JSON-formatted result as body; if it fails, return an
|
||||||
|
HTTP 500 response.</pre></div></div><div class="public anchor" id="var-if-valid-user"><h3>if-valid-user</h3><h4 class="type">macro</h4><div class="usage"><code>(if-valid-user form request error-return)</code><code>(if-valid-user form request)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form` only if there is a valid user in the session of
|
||||||
|
this `request`; otherwise return the `error-return` value.</pre></div></div><div class="public anchor" id="var-valid-user-or-forbid"><h3>valid-user-or-forbid</h3><h4 class="type">macro</h4><div class="usage"><code>(valid-user-or-forbid form request)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form` only if there is a valid user in the session of
|
||||||
|
this `request`; otherwise return an HTTP forbidden response.</pre></div></div><div class="public anchor" id="var-with-params-or-error"><h3>with-params-or-error</h3><h4 class="type">macro</h4><div class="usage"><code>(with-params-or-error form params required)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form` only if these `params` contain all these `required` keys;
|
||||||
|
otherwise return an HTTP 400 response.</pre></div></div></div></body></html>
|
5
doc/adl-support.tags.html
Normal file
5
doc/adl-support.tags.html
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>adl-support.tags 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.tags.html#var-add-tags"><div class="inner"><span>add-tags</span></div></a></li><li class="depth-1"><a href="adl-support.tags.html#var-if-member-of-permitted"><div class="inner"><span>if-member-of-permitted</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.tags</h1><div class="doc"><pre class="plaintext">Application Description Language support - custom Selmer tags used
|
||||||
|
in generated templates.</pre></div><div class="public anchor" id="var-add-tags"><h3>add-tags</h3><div class="usage"><code>(add-tags)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-if-member-of-permitted"><h3>if-member-of-permitted</h3><div class="usage"><code>(if-member-of-permitted args context success failure)</code></div><div class="doc"><pre class="plaintext">If at least one of these `args` matches some group name in the `:user-roles`
|
||||||
|
of this `context`, return this `success`, else this `failure`.</pre></div></div></div></body></html>
|
65
doc/adl-support.utils.html
Normal file
65
doc/adl-support.utils.html
Normal file
File diff suppressed because one or more lines are too long
551
doc/css/default.css
Normal file
551
doc/css/default.css
Normal file
|
@ -0,0 +1,551 @@
|
||||||
|
body {
|
||||||
|
font-family: Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre, code {
|
||||||
|
font-family: Monaco, DejaVu Sans Mono, Consolas, monospace;
|
||||||
|
font-size: 9pt;
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 29px;
|
||||||
|
margin: 10px 0 2px 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5.license {
|
||||||
|
margin: 9px 0 22px 0;
|
||||||
|
color: #555;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.document h1, .namespace-index h1 {
|
||||||
|
font-size: 32px;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header, #content, .sidebar {
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 22px;
|
||||||
|
color: #f5f5f5;
|
||||||
|
padding: 5px 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
top: 32px;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: auto;
|
||||||
|
background: #fff;
|
||||||
|
color: #333;
|
||||||
|
padding: 0 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
position: fixed;
|
||||||
|
top: 32px;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.primary {
|
||||||
|
background: #e2e2e2;
|
||||||
|
border-right: solid 1px #cccccc;
|
||||||
|
left: 0;
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.secondary {
|
||||||
|
background: #f2f2f2;
|
||||||
|
border-right: solid 1px #d7d7d7;
|
||||||
|
left: 251px;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content.namespace-index, #content.document {
|
||||||
|
left: 251px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content.namespace-docs {
|
||||||
|
left: 452px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content.document {
|
||||||
|
padding-bottom: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
background: #3f3f3f;
|
||||||
|
box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header h1 {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: lighter;
|
||||||
|
text-shadow: -1px -1px 0px #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header h1 .project-version {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-version {
|
||||||
|
padding-left: 0.15em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header a, .sidebar a {
|
||||||
|
display: block;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header a {
|
||||||
|
color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar a {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header h2 {
|
||||||
|
float: right;
|
||||||
|
font-size: 9pt;
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 4px 3px;
|
||||||
|
padding: 0;
|
||||||
|
color: #bbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header h2 a {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar h3 {
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 13px 0 13px;
|
||||||
|
font-size: 19px;
|
||||||
|
font-weight: lighter;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar h3 a {
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar h3.no-link {
|
||||||
|
color: #636363;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar ul {
|
||||||
|
padding: 7px 0 6px 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar ul.index-link {
|
||||||
|
padding-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li {
|
||||||
|
display: block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li a, .sidebar li .no-link {
|
||||||
|
border-left: 3px solid transparent;
|
||||||
|
padding: 0 10px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .no-link {
|
||||||
|
display: block;
|
||||||
|
color: #777;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .inner {
|
||||||
|
display: inline-block;
|
||||||
|
padding-top: 7px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li a, .sidebar li .tree {
|
||||||
|
height: 31px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.depth-1 .inner { padding-left: 2px; }
|
||||||
|
.depth-2 .inner { padding-left: 6px; }
|
||||||
|
.depth-3 .inner { padding-left: 20px; }
|
||||||
|
.depth-4 .inner { padding-left: 34px; }
|
||||||
|
.depth-5 .inner { padding-left: 48px; }
|
||||||
|
.depth-6 .inner { padding-left: 62px; }
|
||||||
|
|
||||||
|
.sidebar li .tree {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
position: relative;
|
||||||
|
top: -10px;
|
||||||
|
margin: 0 4px 0 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li.depth-1 .tree {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .tree .top, .sidebar li .tree .bottom {
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
width: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .tree .top {
|
||||||
|
border-left: 1px solid #aaa;
|
||||||
|
border-bottom: 1px solid #aaa;
|
||||||
|
height: 19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li .tree .bottom {
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li.branch .tree .bottom {
|
||||||
|
border-left: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.primary li.current a {
|
||||||
|
border-left: 3px solid #a33;
|
||||||
|
color: #a33;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.secondary li.current a {
|
||||||
|
border-left: 3px solid #33a;
|
||||||
|
color: #33a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index h2 {
|
||||||
|
margin: 30px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index h3 {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index .topics {
|
||||||
|
padding-left: 30px;
|
||||||
|
margin: 11px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index .topics li {
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-docs h3 {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public h3 {
|
||||||
|
margin: 0;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.usage {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public {
|
||||||
|
margin: 0;
|
||||||
|
border-top: 1px solid #e0e0e0;
|
||||||
|
padding-top: 14px;
|
||||||
|
padding-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public:last-child {
|
||||||
|
margin-bottom: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members .public:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members {
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members h4 {
|
||||||
|
color: #555;
|
||||||
|
font-weight: normal;
|
||||||
|
font-variant: small-caps;
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members .inner {
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-left: 12px;
|
||||||
|
margin-top: 2px;
|
||||||
|
margin-left: 7px;
|
||||||
|
border-left: 1px solid #bbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content .members .inner h3 {
|
||||||
|
font-size: 12pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members .public {
|
||||||
|
border-top: none;
|
||||||
|
margin-top: 0;
|
||||||
|
padding-top: 6px;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members .public:first-child {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.type,
|
||||||
|
h4.dynamic,
|
||||||
|
h4.added,
|
||||||
|
h4.deprecated {
|
||||||
|
float: left;
|
||||||
|
margin: 3px 10px 15px 0;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-variant: small-caps;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public h4.type,
|
||||||
|
.public h4.dynamic,
|
||||||
|
.public h4.added,
|
||||||
|
.public h4.deprecated {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 3px 0 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.members h4.type,
|
||||||
|
.members h4.added,
|
||||||
|
.members h4.deprecated {
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.type {
|
||||||
|
color: #717171;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.dynamic {
|
||||||
|
color: #9933aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.added {
|
||||||
|
color: #508820;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4.deprecated {
|
||||||
|
color: #880000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace:last-child {
|
||||||
|
margin-bottom: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index {
|
||||||
|
padding: 0;
|
||||||
|
font-size: 80%;
|
||||||
|
margin: 15px 0;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index * {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index p {
|
||||||
|
padding-right: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index li {
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index ul {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.type-sig {
|
||||||
|
clear: both;
|
||||||
|
color: #088;
|
||||||
|
}
|
||||||
|
|
||||||
|
.type-sig pre {
|
||||||
|
padding-top: 10px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.usage code {
|
||||||
|
display: block;
|
||||||
|
color: #008;
|
||||||
|
margin: 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.usage code:first-child {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public p:first-child, .public pre.plaintext {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc {
|
||||||
|
margin: 0 0 26px 0;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.public .doc {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index .doc {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace-index .namespace .doc {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown p, .markdown li, .markdown dt, .markdown dd, .markdown td {
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown li {
|
||||||
|
padding: 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown h2 {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 25px;
|
||||||
|
margin: 30px 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown h3 {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 20px;
|
||||||
|
margin: 30px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown h4 {
|
||||||
|
font-size: 15px;
|
||||||
|
margin: 22px 0 -4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc, .public, .namespace .index {
|
||||||
|
max-width: 680px;
|
||||||
|
overflow-x: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown pre > code {
|
||||||
|
display: block;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown pre > code, .src-link a {
|
||||||
|
border: 1px solid #e4e4e4;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown code:not(.hljs), .src-link a {
|
||||||
|
background: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.deps {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px;
|
||||||
|
border: 1px solid #e4e4e4;
|
||||||
|
border-radius: 2px;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown hr {
|
||||||
|
border-style: solid;
|
||||||
|
border-top: none;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc ul, .doc ol {
|
||||||
|
padding-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc table td, .doc table th {
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
padding: 4px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc table th {
|
||||||
|
background: #f2f2f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc dl {
|
||||||
|
margin: 0 10px 20px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc dl dt {
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0;
|
||||||
|
padding: 3px 0;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc dl dd {
|
||||||
|
padding: 5px 0;
|
||||||
|
margin: 0 0 5px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc abbr {
|
||||||
|
border-bottom: 1px dotted #333;
|
||||||
|
font-variant: none;
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-link {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.src-link a {
|
||||||
|
font-size: 70%;
|
||||||
|
padding: 1px 4px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: #5555bb;
|
||||||
|
}
|
97
doc/css/highlight.css
Normal file
97
doc/css/highlight.css
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
/*
|
||||||
|
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
.hljs {
|
||||||
|
display: block;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding: 0.5em;
|
||||||
|
color: #333;
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-comment,
|
||||||
|
.hljs-quote {
|
||||||
|
color: #998;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-keyword,
|
||||||
|
.hljs-selector-tag,
|
||||||
|
.hljs-subst {
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-number,
|
||||||
|
.hljs-literal,
|
||||||
|
.hljs-variable,
|
||||||
|
.hljs-template-variable,
|
||||||
|
.hljs-tag .hljs-attr {
|
||||||
|
color: #008080;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-string,
|
||||||
|
.hljs-doctag {
|
||||||
|
color: #d14;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-title,
|
||||||
|
.hljs-section,
|
||||||
|
.hljs-selector-id {
|
||||||
|
color: #900;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-subst {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-type,
|
||||||
|
.hljs-class .hljs-title {
|
||||||
|
color: #458;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-tag,
|
||||||
|
.hljs-name,
|
||||||
|
.hljs-attribute {
|
||||||
|
color: #000080;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-regexp,
|
||||||
|
.hljs-link {
|
||||||
|
color: #009926;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-symbol,
|
||||||
|
.hljs-bullet {
|
||||||
|
color: #990073;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-built_in,
|
||||||
|
.hljs-builtin-name {
|
||||||
|
color: #0086b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-meta {
|
||||||
|
color: #999;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-deletion {
|
||||||
|
background: #fdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-addition {
|
||||||
|
background: #dfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-emphasis {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
8
doc/index.html
Normal file
8
doc/index.html
Normal file
File diff suppressed because one or more lines are too long
4
doc/intro.html
Normal file
4
doc/intro.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>Introduction to adl-support</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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 current"><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#introduction-to-adl-support" name="introduction-to-adl-support"></a>Introduction to adl-support</h1>
|
||||||
|
<p><code>adl-support</code> is a small library of functions used by the <a href="https://github.com/simon-brooke/adl">Application Description Language</a> system to generate elements of a Clojure web-app, which may be useful to people writing web-apps either based on Application Description Language or otherwise.</p></div></div></div></body></html>
|
|
@ -1,3 +1,6 @@
|
||||||
# Introduction to adl-support
|
# Introduction to adl-support
|
||||||
|
|
||||||
TODO: write [great documentation](http://jacobian.org/writing/what-to-write/)
|
`adl-support` is a small library of functions used by the [Application
|
||||||
|
Description Language](https://github.com/simon-brooke/adl) system to generate
|
||||||
|
elements of a Clojure web-app, which may be useful to people writing web-apps
|
||||||
|
either based on Application Description Language or otherwise.
|
||||||
|
|
2
doc/js/highlight.min.js
vendored
Normal file
2
doc/js/highlight.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
doc/js/jquery.min.js
vendored
Normal file
4
doc/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
112
doc/js/page_effects.js
Normal file
112
doc/js/page_effects.js
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
function visibleInParent(element) {
|
||||||
|
var position = $(element).position().top
|
||||||
|
return position > -50 && position < ($(element).offsetParent().height() - 50)
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasFragment(link, fragment) {
|
||||||
|
return $(link).attr("href").indexOf("#" + fragment) != -1
|
||||||
|
}
|
||||||
|
|
||||||
|
function findLinkByFragment(elements, fragment) {
|
||||||
|
return $(elements).filter(function(i, e) { return hasFragment(e, fragment)}).first()
|
||||||
|
}
|
||||||
|
|
||||||
|
function scrollToCurrentVarLink(elements) {
|
||||||
|
var elements = $(elements);
|
||||||
|
var parent = elements.offsetParent();
|
||||||
|
|
||||||
|
if (elements.length == 0) return;
|
||||||
|
|
||||||
|
var top = elements.first().position().top;
|
||||||
|
var bottom = elements.last().position().top + elements.last().height();
|
||||||
|
|
||||||
|
if (top >= 0 && bottom <= parent.height()) return;
|
||||||
|
|
||||||
|
if (top < 0) {
|
||||||
|
parent.scrollTop(parent.scrollTop() + top);
|
||||||
|
}
|
||||||
|
else if (bottom > parent.height()) {
|
||||||
|
parent.scrollTop(parent.scrollTop() + bottom - parent.height());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCurrentVarLink() {
|
||||||
|
$('.secondary a').parent().removeClass('current')
|
||||||
|
$('.anchor').
|
||||||
|
filter(function(index) { return visibleInParent(this) }).
|
||||||
|
each(function(index, element) {
|
||||||
|
findLinkByFragment(".secondary a", element.id).
|
||||||
|
parent().
|
||||||
|
addClass('current')
|
||||||
|
});
|
||||||
|
scrollToCurrentVarLink('.secondary .current');
|
||||||
|
}
|
||||||
|
|
||||||
|
var hasStorage = (function() { try { return localStorage.getItem } catch(e) {} }())
|
||||||
|
|
||||||
|
function scrollPositionId(element) {
|
||||||
|
var directory = window.location.href.replace(/[^\/]+\.html$/, '')
|
||||||
|
return 'scroll::' + $(element).attr('id') + '::' + directory
|
||||||
|
}
|
||||||
|
|
||||||
|
function storeScrollPosition(element) {
|
||||||
|
if (!hasStorage) return;
|
||||||
|
localStorage.setItem(scrollPositionId(element) + "::x", $(element).scrollLeft())
|
||||||
|
localStorage.setItem(scrollPositionId(element) + "::y", $(element).scrollTop())
|
||||||
|
}
|
||||||
|
|
||||||
|
function recallScrollPosition(element) {
|
||||||
|
if (!hasStorage) return;
|
||||||
|
$(element).scrollLeft(localStorage.getItem(scrollPositionId(element) + "::x"))
|
||||||
|
$(element).scrollTop(localStorage.getItem(scrollPositionId(element) + "::y"))
|
||||||
|
}
|
||||||
|
|
||||||
|
function persistScrollPosition(element) {
|
||||||
|
recallScrollPosition(element)
|
||||||
|
$(element).scroll(function() { storeScrollPosition(element) })
|
||||||
|
}
|
||||||
|
|
||||||
|
function sidebarContentWidth(element) {
|
||||||
|
var widths = $(element).find('.inner').map(function() { return $(this).innerWidth() })
|
||||||
|
return Math.max.apply(Math, widths)
|
||||||
|
}
|
||||||
|
|
||||||
|
function calculateSize(width, snap, margin, minimum) {
|
||||||
|
if (width == 0) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Math.max(minimum, (Math.ceil(width / snap) * snap) + (margin * 2))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function resizeSidebars() {
|
||||||
|
var primaryWidth = sidebarContentWidth('.primary')
|
||||||
|
var secondaryWidth = 0
|
||||||
|
|
||||||
|
if ($('.secondary').length != 0) {
|
||||||
|
secondaryWidth = sidebarContentWidth('.secondary')
|
||||||
|
}
|
||||||
|
|
||||||
|
// snap to grid
|
||||||
|
primaryWidth = calculateSize(primaryWidth, 32, 13, 160)
|
||||||
|
secondaryWidth = calculateSize(secondaryWidth, 32, 13, 160)
|
||||||
|
|
||||||
|
$('.primary').css('width', primaryWidth)
|
||||||
|
$('.secondary').css('width', secondaryWidth).css('left', primaryWidth + 1)
|
||||||
|
|
||||||
|
if (secondaryWidth > 0) {
|
||||||
|
$('#content').css('left', primaryWidth + secondaryWidth + 2)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#content').css('left', primaryWidth + 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(window).ready(resizeSidebars)
|
||||||
|
$(window).ready(setCurrentVarLink)
|
||||||
|
$(window).ready(function() { persistScrollPosition('.primary')})
|
||||||
|
$(window).ready(function() {
|
||||||
|
$('#content').scroll(setCurrentVarLink)
|
||||||
|
$(window).resize(setCurrentVarLink)
|
||||||
|
})
|
|
@ -13,9 +13,11 @@
|
||||||
:plugins [[lein-codox "0.10.4"]
|
:plugins [[lein-codox "0.10.4"]
|
||||||
[lein-release "1.1.3"]]
|
[lein-release "1.1.3"]]
|
||||||
|
|
||||||
;; `lein release` doesn't work with `git flow release`. To use
|
:codox {:metadata {:doc "FIXME: write docs"}
|
||||||
;; `lein release`, first merge `develop` into `master`, and then, in branch
|
:output-path "doc"}
|
||||||
;; `master`, run `lein release`
|
|
||||||
|
;; `lein release` doesn't play nice with `git flow release`. Run `lein release` in the
|
||||||
|
;; `develop` branch, then merge the release tag into the `master` branch.
|
||||||
|
|
||||||
:release-tasks [["vcs" "assert-committed"]
|
:release-tasks [["vcs" "assert-committed"]
|
||||||
["clean"]
|
["clean"]
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
(ns adl-support.core
|
(ns ^{:doc "Application Description Language support - utility functions likely
|
||||||
|
to be useful in user-written code."
|
||||||
|
:author "Simon Brooke"}
|
||||||
|
adl-support.core
|
||||||
(:require [clojure.core.memoize :as memo]
|
(:require [clojure.core.memoize :as memo]
|
||||||
[clojure.data.json :as json]
|
[clojure.data.json :as json]
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
(ns adl-support.filters
|
(ns ^{:doc "Application Description Language support - custom Selmer filters
|
||||||
|
used in generated templates."
|
||||||
|
:author "Simon Brooke"}
|
||||||
|
adl-support.filters
|
||||||
(:require [clojure.string :as s]
|
(:require [clojure.string :as s]
|
||||||
[selmer.filters :as f]
|
[selmer.filters :as f]
|
||||||
[selmer.parser :as p]))
|
[selmer.parser :as p]))
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
(ns adl-support.forms-support
|
(ns ^{:doc "Application Description Language support - functions useful in
|
||||||
|
generating forms."
|
||||||
|
:author "Simon Brooke"}
|
||||||
|
adl-support.forms-support
|
||||||
(:require [adl-support.core :refer :all]
|
(:require [adl-support.core :refer :all]
|
||||||
[adl-support.utils :refer [descendants-with-tag safe-name singularise]]
|
[adl-support.utils :refer [descendants-with-tag safe-name singularise]]
|
||||||
[clojure.core.memoize :as memo]
|
[clojure.core.memoize :as memo]
|
||||||
|
@ -49,6 +52,7 @@
|
||||||
|
|
||||||
|
|
||||||
(defmacro get-current-value
|
(defmacro get-current-value
|
||||||
|
"Use the function `f` and these `params` to fetch an `entity` record from the database."
|
||||||
[f params entity-name]
|
[f params entity-name]
|
||||||
`(let
|
`(let
|
||||||
[message# (str "Error while fetching " ~entity-name " record " ~params)]
|
[message# (str "Error while fetching " ~entity-name " record " ~params)]
|
||||||
|
@ -59,6 +63,9 @@
|
||||||
|
|
||||||
|
|
||||||
(defmacro get-menu-options
|
(defmacro get-menu-options
|
||||||
|
"Fetch options for a menu of `entity-name` from the database, using this
|
||||||
|
`get-q` query and this `list-q` query, using the key `fk`, where the current
|
||||||
|
value is this `value`."
|
||||||
[entity-name get-q list-q fk value]
|
[entity-name get-q list-q fk value]
|
||||||
`(remove
|
`(remove
|
||||||
nil?
|
nil?
|
||||||
|
@ -107,6 +114,8 @@
|
||||||
|
|
||||||
|
|
||||||
(defn property-defaults
|
(defn property-defaults
|
||||||
|
"Get a map of property names and default values for all properties of this
|
||||||
|
`entity` which have explicit defaults."
|
||||||
[entity]
|
[entity]
|
||||||
(reduce
|
(reduce
|
||||||
merge {}
|
merge {}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
(ns adl-support.print-usage
|
(ns ^{:doc "Application Description Language support - print a usage message."
|
||||||
|
:author "Simon Brooke"}
|
||||||
|
adl-support.print-usage
|
||||||
(:require [clojure.string :refer [join]]))
|
(:require [clojure.string :refer [join]]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
(ns adl-support.rest-support
|
(ns ^{:doc "Application Description Language support - functions useful in
|
||||||
|
generating JSON route handlers."
|
||||||
|
:author "Simon Brooke"}
|
||||||
|
adl-support.rest-support
|
||||||
(:require [adl-support.core :refer [do-or-log-error do-or-return-reason]]
|
(:require [adl-support.core :refer [do-or-log-error do-or-return-reason]]
|
||||||
[clojure.core.memoize :as memo]
|
[clojure.core.memoize :as memo]
|
||||||
[clojure.data.json :as json]
|
[clojure.data.json :as json]
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
(ns adl-support.tags
|
(ns ^{:doc "Application Description Language support - custom Selmer tags used
|
||||||
|
in generated templates."
|
||||||
|
:author "Simon Brooke"}
|
||||||
|
adl-support.tags
|
||||||
(:require [selmer.parser :as p]))
|
(:require [selmer.parser :as p]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(ns ^{:doc "Application Description Language support library - utility functions."
|
(ns ^{:doc "Application Description Language support - utility functions."
|
||||||
:author "Simon Brooke"}
|
:author "Simon Brooke"}
|
||||||
adl-support.utils
|
adl-support.utils
|
||||||
(:require [adl-support.core :refer [*warn*]]
|
(:require [adl-support.core :refer [*warn*]]
|
||||||
|
@ -86,6 +86,7 @@
|
||||||
|
|
||||||
|
|
||||||
(defn sort-by-name
|
(defn sort-by-name
|
||||||
|
"Sort these `elements` by their `:name` attribute."
|
||||||
[elements]
|
[elements]
|
||||||
(sort #(compare (:name (:attrs %1)) (:name (:attrs %2))) elements))
|
(sort #(compare (:name (:attrs %1)) (:name (:attrs %2))) elements))
|
||||||
|
|
||||||
|
@ -266,8 +267,10 @@
|
||||||
|
|
||||||
|
|
||||||
(defn pretty-name
|
(defn pretty-name
|
||||||
[entity]
|
"Return a version of the name of this `element` (entity, field,
|
||||||
(capitalise (singularise (:name (:attrs entity)))))
|
form, list, page, property) suitable for use in text visible to the user."
|
||||||
|
[element]
|
||||||
|
(capitalise (singularise (:name (:attrs element)))))
|
||||||
|
|
||||||
|
|
||||||
(defn safe-name
|
(defn safe-name
|
||||||
|
|
Loading…
Reference in a new issue