Merge similar symbols

This commit is contained in:
oakes
2014-03-31 14:10:22 -04:00
parent 1cc40a3b32
commit baeaca0af6
2 changed files with 14 additions and 6 deletions

View File

@@ -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]

View File

@@ -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)]