Merge similar symbols
This commit is contained in:
@@ -89,10 +89,19 @@
|
||||
(sort-by first)
|
||||
vec)))))
|
||||
|
||||
(defn merge-groups
|
||||
[groups]
|
||||
(for [{:keys [name] :as group} groups]
|
||||
(when (and name (not (.endsWith name "*")))
|
||||
(->> (some #(if (= (:name %) (str name "*")) %) groups)
|
||||
:raw
|
||||
(assoc group :raw*)))))
|
||||
|
||||
(defn process-groups
|
||||
[{:keys [groups] :as parsed-file} doc-map]
|
||||
(->> (map #(process-group % doc-map) groups)
|
||||
(remove #(nil? (:name %)))
|
||||
merge-groups
|
||||
(remove nil?)
|
||||
(assoc parsed-file :groups)))
|
||||
|
||||
(defn parse-clj
|
||||
@@ -103,7 +112,8 @@
|
||||
(sort-by #(.getName %))
|
||||
(map #(.getCanonicalPath %))
|
||||
(map marg/path-to-doc)
|
||||
(map #(process-groups % doc-map))))
|
||||
(map #(process-groups % doc-map))
|
||||
(filter #(> (count (:groups %)) 0))))
|
||||
|
||||
(defn save
|
||||
[parsed-files]
|
||||
|
||||
@@ -16,14 +16,12 @@
|
||||
[:b (str name)]
|
||||
" "
|
||||
(string/join ", " (map param args))]
|
||||
(when text
|
||||
[:i text])])
|
||||
(when text [:i text])])
|
||||
|
||||
(defn create-from-file
|
||||
[{:keys [ns groups] :as parsed-file}]
|
||||
[:div
|
||||
(when (and ns (> (count groups) 0))
|
||||
[:h1 ns])
|
||||
(when ns [:h1 ns])
|
||||
(for [group groups]
|
||||
[:div
|
||||
[:h2 {} (:name group)]
|
||||
|
||||
Reference in New Issue
Block a user