Skip to content

Commit

Permalink
Rename fns
Browse files Browse the repository at this point in the history
  • Loading branch information
zampino committed Aug 28, 2023
1 parent 97a4859 commit d7af180
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions notebooks/doc.clj
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
(when nss
(into [:div.ml-3] (map render-ns) nss))])

(defn branch-fn [nss-map ns-name]
(defn ns-node-with-branches [nss-map ns-name]
(let [sub-nss (get nss-map ns-name)
vars (some-> ns-name symbol find-ns ns-publics not-empty vals vec)]
(cond-> {:name ns-name}
sub-nss (assoc :nss (mapv (partial branch-fn nss-map) sub-nss))
sub-nss (assoc :nss (mapv (partial ns-node-with-branches nss-map) sub-nss))
vars (assoc :vars vars))))

(defn ns-tree
Expand All @@ -68,7 +68,7 @@
(if-some [ns-name (first ns-matches)]
(recur nss-map
(remove #(str/starts-with? % ns-name) ns-matches)
(conj acc (branch-fn nss-map ns-name)))
(conj acc (ns-node-with-branches nss-map ns-name)))
acc)))

#_(ns-tree ns-matches)
Expand Down

0 comments on commit d7af180

Please sign in to comment.