File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change 55 [clojure.java.io :as io]))
66
77; ; TODO: do something whenever the mode has just `.yas-parents` and nothing else?
8+ (def bulma-url " https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.css" )
89
910(defn kw-pattern
1011 [kw]
4748(def header [:name :key :group :filename ])
4849
4950(defn table
51+ " Generate a table"
5052 [header rows]
5153 [:table.table.is-striped
5254 [:thead (into [:tr.tr ]
5961 (for [h header]
6062 [:td.td (r h)]))))])
6163
62- [:link {:rel " stylesheet"
63- :href " https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.css"
64- :crossorigin " anonymous" }]
64+ (defn structure
65+ [body]
66+ [:html
67+ [:head
68+ [:link {:rel " stylesheet"
69+ :href bulma-url
70+ :crossorigin " anonymous" }]]
71+ [:body body]])
6572
6673(defn gen-html
6774 [snips-dir]
6875 (let [all-modes (parse-everything snips-dir)
69- tables (for [[m snips] all-modes]
70- [:html
71- [:head
72- [:link {:rel " stylesheet"
73- :href " https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.css"
74- :crossorigin " anonymous" }]]
75- [:body
76- [:div.hero
77- [:h2 m]
78- (table header snips)]]])]
76+ tables (for [[m snips] (take 10 (sort all-modes))]
77+ [:div
78+ [:h2 m]
79+ (table header snips)])]
7980 (spit
8081 " hello.html"
8182 (hiccup/html tables))))
You can’t perform that action at this time.
0 commit comments