Skip to content

Commit

Permalink
Simplify more
Browse files Browse the repository at this point in the history
  • Loading branch information
zampino committed Dec 13, 2023
1 parent 3703fc9 commit ea914d4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions notebooks/viewers/context.clj
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@
;; Or build a viewer which will display the namespace's name and docs:

(def ns-viewer
{:pred {:wrapped (fn [{:keys [ns?]}] ns?)}
{:pred {:wrapped :ns?}
:transform-fn (fn [{:as wv :keys [form]}]
(let [doc-ns (find-ns (second form))]
(clerk/html [:blockquote.bg-sky-50.rounded.py-1
(clerk/md (str "## " (ns-name doc-ns) "\n" (:doc (meta doc-ns))))])))})

;; In addition, transform-fns can hook onto the visibility of results to, say, override defaults or make the result of the
;; ns cell show up
;; In addition, by customizing the cell viewer we might override visibility defaults
(def cell-viewer
(update viewer/cell-viewer
:transform-fn comp
Expand Down

0 comments on commit ea914d4

Please sign in to comment.