File tree Expand file tree Collapse file tree 1 file changed +35
-7
lines changed Expand file tree Collapse file tree 1 file changed +35
-7
lines changed Original file line number Diff line number Diff line change 6363 (for [s snips]
6464 (render-snip s)))))
6565
66- (comment
67- (let [all-modes (parse-everything " ../snippets" )
68- hicup (edn->hiccup all-modes)
69- content [:html
70- (into [:body ]
71- hicup)]]
66+ (def header [:name :key :group :filename ])
67+
68+ (defn table
69+ [header rows]
70+ [:table.table
71+ [:thead (into [:tr.tr ]
72+ (for [h header]
73+ [:td.td (name h)]))]
74+
75+ (into [:tbody.tbody ]
76+ (for [r rows]
77+ (into [:tr.tr ]
78+ (for [h header]
79+ [:td.td (r h)]))))])
80+
81+ [:link {:rel " stylesheet"
82+ :href " https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.css"
83+ :crossorigin " anonymous" }]
84+
85+ (defn gen-html
86+ [snips-dir]
87+ (let [all-modes (parse-everything snips-dir)
88+ tables (for [[m snips] all-modes]
89+ [:html
90+ [:head
91+ [:link {:rel " stylesheet"
92+ :href " https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.css"
93+ :crossorigin " anonymous" }]]
94+ [:body
95+ [:div m
96+ (table header snips)]]])]
7297 (spit
7398 " hello.html"
74- (hiccup/html content))))
99+ (hiccup/html tables))))
100+
101+ (comment
102+ (gen-html " ../snippets" ))
You can’t perform that action at this time.
0 commit comments