Re:A fast EDN (Extensible Data Notation) reader written in C...
by HexDecOctBin on Monday November 24, 2025 @10:02PM
(#46041925)
Can the metadata feature be used to ergonomically emulate HTML attributes? It's not clear from the docs, and the spec doesn't seem to document the feature at all.
[ Parent
| on HN ]
Re:A fast EDN (Extensible Data Notation) reader written in C...
by nerdponx on Monday November 24, 2025 @10:45PM
(#46042160)
I'm not sure how the metadata syntax works, but you might not need it because you can do this:
(html
(head
(title "Hello!"))
(body
(div
(p
"This is an example of a hyperlink: "
(a "Example" :href "https://example.org/")))))
Re:A fast EDN (Extensible Data Notation) reader written in C...
by delaguardo on Tuesday November 25, 2025 @01:26AM
(#46042890)
I think you can use metadata to model html attributes but in clojure people are using plain vector for that. https://github.com/weavejester/hiccup
tl;dr first element of the vector is a tag, second is a map of attributes test are children nodes:
[:h1 {:font-size "2em" :font-weight bold} "General Kenobi, you are a bold one"]
Re:A fast EDN (Extensible Data Notation) reader written in C...
by geokon on Thursday November 27, 2025 @01:07AM
(#46066213)
Also Hickory。。
https://github.com/clj-commons/hickory
i feel hiccup indexed based magic is a common design pattern you see in early Clojure and its less common now (id say hiccup is the exception that lives on)