Skip to content

Commit 524721e

Browse files
committed
Pass at docs
1 parent cadd27d commit 524721e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/nextjournal/clerk.clj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,16 @@
222222
([viewer-opts x] (v/html viewer-opts x)))
223223

224224
(defn md
225-
"Displays `x` with the markdown viewer.
225+
"Displays `x` with the markdown viewer. Accepts strings or a structure as returned by [[nextjournal.markdown/parse]].
226226
227227
Supports an optional first `viewer-opts` map arg with the following optional keys:
228228
229229
* `:nextjournal.clerk/width`: set the width to `:full`, `:wide`, `:prose`
230230
* `:nextjournal.clerk/viewers`: a seq of viewers to use for presentation of this value and its children
231-
* `:nextjournal.clerk/render-opts`: a map argument that will be passed as a secong arg to the viewers `:render-fn`"
231+
* `:nextjournal.clerk/render-opts`: a map argument that will be passed as a secong arg to the viewers `:render-fn`.
232+
233+
See also [[nextjournal.clerk.viewer/markdown-viewer]]."
234+
232235
([x] (v/md x))
233236
([viewer-opts x] (v/md viewer-opts x)))
234237

@@ -553,7 +556,7 @@
553556
#_(with-cache (do (Thread/sleep 4200) 42))
554557

555558
(defmacro defcached
556-
"Like `clojure.core/def` but with Clerk's caching of the value."
559+
"Like `clojure.core/def` but with Clerk's caching of the value. See also [[with-cache]]."
557560
[name expr]
558561
`(let [result# (-> ~(v/->edn expr) eval/eval-string :blob->result first val :nextjournal/value)]
559562
(def ~name result#)))

src/nextjournal/clerk/viewer.cljc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,9 @@
472472
%)
473473
presented-result)))
474474

475-
(defn get-default-viewers []
475+
(defn get-default-viewers
476+
"Returns viewers from the global scope when set, defaults to [[default-viewers]] (see also [[!viewers]])."
477+
[]
476478
(:default @!viewers default-viewers))
477479

478480
(defn datafy-scope [scope]
@@ -982,6 +984,7 @@
982984
{:name `vega-lite-viewer :render-fn 'nextjournal.clerk.render/render-vega-lite :transform-fn mark-presented})
983985

984986
(def markdown-viewer
987+
"A clerk viewer for rendering markdown. See also [[nextjournal.clerk/md]]."
985988
{:name `markdown-viewer
986989
:add-viewers markdown-viewers
987990
:transform-fn (fn [wrapped-value]

0 commit comments

Comments
 (0)