File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 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
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 #)))
Original file line number Diff line number Diff line change 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]
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]
You can’t perform that action at this time.
0 commit comments