ethica

Spinozas ethics and various translations, edited for easy post processing.
git clone https://git.repetitions.de/ethica

node.chtml (1913B)


 1 <c:let vkey="vkey"
 2        node="node"
 3        level="level"
 4        types="types"
 5        id="(gethash &quot;id&quot; node)"
 6        type="(gethash &quot;type&quot; node)"
 7        refs="(gethash &quot;ref&quot; node)"
 8        backlinks="(gethash :links node)"
 9        children="(gethash :child-nodes node)">
10     <div class="node"
11          lquery="(attr :id id) (add-class type)">
12         <c:expand class="headline" lquery="(attr :as (format nil &quot;h~a&quot; level))">
13             <c:s>(format nil "~a ~a" (gethash type types) (or (gethash "number" node) ""))</c:s>
14             <a class="anchor" href="#{id}" fill="href *">#<c:s>id</c:s></a>
15         </c:expand> 
16         <c:when test="backlinks">
17             <div class="backlinks">
18                 <label>Referenced by:</label>
19                 <c:splice iterate="backlinks">
20                     <c:let target="*">
21                         <a href="#{target}"
22                            fill="href *"
23                            lquery="(text target)">
24                         </a>
25                     </c:let>
26                 </c:splice>
27             </div>
28         </c:when>
29         <div class="node-body">
30             <c:h>(markdown:parse (or (gethash vkey node) ""))</c:h>
31         </div>
32         <c:when test="refs">
33             <div class="refs" >
34                 <label>References:</label>
35                 <c:splice iterate="refs">
36                     <c:let target="*">
37                         <a href="#{target}"
38                            fill="href *"
39                            lquery="(text target)">
40                         </a>
41                     </c:let>
42                 </c:splice>
43             </div>
44         </c:when>
45         <when test="children">
46             <div class="node-children" iterate="children">
47                 <c:h>(ethics::make-node * (** :vkey) (** :types) (+ (** :level) 1))</c:h>
48             </div>
49         </when>
50     </div>
51 </c:let>
52