Skip to content

Commit 2e2514f

Browse files
committed
cleanup old hiccup code
1 parent 8f1a8f1 commit 2e2514f

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

report/src/core.clj

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,11 @@
4444
[snippets-dir output-file]
4545
(spit output-file (parse-everything snippets-dir)))
4646

47-
(defn render-snip
48-
[{:keys [name key group filename]}]
49-
(when name
50-
[:ul
51-
(filter some?
52-
[[:li {:class "field"} "name: " name]
53-
(when key [:li {:class "field"} "key: " key])
54-
(when group [:li {:class "field"} "group: " group])
55-
(when filename [:li {:class "field"} "filename: " filename])])]))
56-
57-
(defn edn->hiccup
58-
"Transform the data structure containing all the modes described
59-
into an hiccup data structure"
60-
[modes]
61-
(for [[m snips] (sort-by first modes)]
62-
(into [:div.mode (str "Mode: " m)]
63-
(for [s snips]
64-
(render-snip s)))))
65-
6647
(def header [:name :key :group :filename])
6748

6849
(defn table
6950
[header rows]
70-
[:table.table
51+
[:table.table.is-striped
7152
[:thead (into [:tr.tr]
7253
(for [h header]
7354
[:td.td (name h)]))]
@@ -92,7 +73,8 @@
9273
:href "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.css"
9374
:crossorigin "anonymous"}]]
9475
[:body
95-
[:div m
76+
[:div.hero
77+
[:h2 m]
9678
(table header snips)]]])]
9779
(spit
9880
"hello.html"

0 commit comments

Comments
 (0)