ethica

Spinozas ethics and various translations, edited for easy post processing.
git clone https://git.repetitions.de/ethica
commit e6382c9c6da9e157c19fb9c2e445a519c6f571c6
parent 8b1ba0b80fd5fc201ad3643da37613742417d790
Author: lou woell <lou@repetitions.de>
Date:   Sat,  7 Nov 2026 00:53:07 +0100

cleanup

Diffstat:
Mhtml/ethics.chtml | 2+-
Mhtml/node.chtml | 53+++++++++++++++++++++++------------------------------
Mlisp/ethics.lisp | 7+++++++
3 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/html/ethics.chtml b/html/ethics.chtml @@ -1,5 +1,5 @@ <!DOCTYPE HTML> -<html lquery="(attr :lang language)"> +<html lquery="(attr :lang (language version))"> <head> <title> <c:s>(node-type ethica version)</c:s>: <c:s>(name version)</c:s> diff --git a/html/node.chtml b/html/node.chtml @@ -1,37 +1,30 @@ -<div class="node" lquery="(attr :id id) (add-class type)"> +<div class="node" lquery="(attr :id (id node)) (add-class (ntype node))"> <c:expand class="headline" fill="as *" as="h{level}"> <c:s>(node-type node version)</c:s> <c:s>(or (num node) "")</c:s> - <a class="anchor" fill="href node" href="#{id}"> - #<c:s>(id node)</c:s> - </a> + <a class="anchor" + fill="href node text node" + href="#{ID}" + text="#{ID}"/> </c:expand> <c:md class="node-body" node="node"/> - <c:when test="(backlinks node)"> - <div class="backlinks"> - <label>Referenced by:</label> - <c:splice iterate="(backlinks node)"> - <c:let target="*"> - <a href="#{target}" - fill="href *" - lquery="(text target)"> - </a> - </c:let> - </c:splice> - </div> - </c:when> - <c:when test="(ref-keys node)"> - <div class="refs" > - <label>References:</label> - <c:splice iterate="(ref-keys node)"> - <c:let target="*"> - <a fill="href *" - href="#{target}" - lquery="(text target)"> - </a> - </c:let> - </c:splice> - </div> - </c:when> + <div class="links"> + <c:when test="(backlinks node)"> + <div class="backlinks"> + <label>Referenced by:</label> + <c:splice iterate="(backlinks node)"> + <a fill="href * text *" href="#{}" text="{}"/> + </c:splice> + </div> + </c:when> + <c:when test="(ref-keys node)"> + <div class="refs" > + <label>References:</label> + <c:splice iterate="(ref-keys node)"> + <a fill="href * text *" href="#{}" text="{}"/> + </c:splice> + </div> + </c:when> + </div> <when test="(children node)"> <div class="node-children" iterate="(children node)"> <c:node node="*"/> diff --git a/lisp/ethics.lisp b/lisp/ethics.lisp @@ -85,6 +85,9 @@ (let ((path (merge-pathnames template (getf config :template-dir)))) (plump:parse path)))))) +(defmethod clip:clip ((value string) field) + value) + (defun read-meta (json) (jzon:with-parser (parser json) (let (top stack key) @@ -236,6 +239,10 @@ (lquery:$1 xml-node (html (make-node result))) (clip:process-tag "splice" xml-node))) +(clip:define-attribute-processor text (node value) + (lquery:$1 node (text value)) + (plump:remove-attribute node "text")) + ;; --- plumbing (defmacro parse-args (&rest args)