ethica

Spinozas ethics and various translations, edited for easy post processing.
git clone https://git.repetitions.de/ethica
commit 5b28d0fb3c98ea66bf57691e8440f5a1d43f2d7c
parent ff594dd7b406b79aed5a2e1b43c23b7a2e9ad04d
Author: lou woell <lou@repetitions.de>
Date:   Fri, 23 Oct 2026 01:35:55 +0200

simplify

Diffstat:
Mlisp/ethics.lisp | 23++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/lisp/ethics.lisp b/lisp/ethics.lisp @@ -93,11 +93,11 @@ bindings) out))) -(defun make-node (node vkey types &optional (level 1)) +(defun make-node (node vkey types &optional (level 0)) (clip:process (merge-pathnames #p"node.chtml" (getf config :template-dir)) :node node - :level level + :level (1+ (or level 0)) :vkey vkey :types types :id (gethash "id" node) @@ -137,15 +137,16 @@ (clip:define-tag-processor node (xml-node) (clip:process-attributes xml-node) - (lquery:$1 xml-node - (html (make-node (clip:resolve-attribute xml-node "node") - (clip:resolve-attribute xml-node "vkey") - (clip:resolve-attribute xml-node "types") - (+ 1 (clip:resolve-attribute xml-node "level" 0))))) - (plump:remove-attribute xml-node "node") - (plump:remove-attribute xml-node "level") - (plump:remove-attribute xml-node "vkey") - (plump:remove-attribute xml-node "types") + + ;; order of attribute strings must be according to the order of + ;; arguments for `make-node'. + + (loop :for attr :in '("node" "vkey" "types" "level") + :collect (clip:resolve-attribute xml-node attr) + :into result + :do (plump:remove-attribute xml-node attr) + :finally (lquery:$1 xml-node (html (apply #'make-node result)))) + (clip:process-tag "splice" xml-node)) ;; --- plumbing