summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2025-10-26 11:34:51 +0200
committerAsko Nõmm <asko@nmm.ee>2025-10-26 11:34:51 +0200
commita0a150d89d30af3ca4d586fc7874d70778b51e73 (patch)
treee1be8dfb423488d6f1846d5890dd5cef59333ca5 /README.md
parentbb8a17fa2517324ac6cd0ce498dcc189a2d8fb2c (diff)
Update README
Diffstat (limited to 'README.md')
-rw-r--r--README.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md
index 003cd07..d106d1b 100644
--- a/README.md
+++ b/README.md
@@ -95,6 +95,23 @@ The function you provide to `traverse` dictates the outcome for each node:
* To **remove a node**, return `nil`.
* To **replace a node with many nodes on the same level**, return a [fragment node](#fragment-nodes), which will be replaced by its children during HTML transformation.
+#### Zipping
+
+You can also use the `dompa.nodes/zip` function to create a [zipper](https://clojuredocs.org/clojure.zip/zipper) of a node, i.e:
+
+```clojure
+(ns my.app
+ (:require [dompa.nodes :as nodes]
+ [clojure.zip :as zip])
+
+(->> (nodes/zip {..node})
+ zip/down
+ zip/node)
+```
+
+And of course you can use this in combination with the `traverse` method as well, since the `traverse` method always operates on a single node at a time,
+and the zipper always starts with a root node, the two complement each other well.
+
-----
### 🛠️ Building Nodes with the `$` Helper