File tree 2 files changed +10
-4
lines changed 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 222
222
([viewer-opts x] (v/html viewer-opts x)))
223
223
224
224
(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]].
226
226
227
227
Supports an optional first `viewer-opts` map arg with the following optional keys:
228
228
229
229
* `:nextjournal.clerk/width`: set the width to `:full`, `:wide`, `:prose`
230
230
* `: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
+
232
235
([x] (v/md x))
233
236
([viewer-opts x] (v/md viewer-opts x)))
234
237
553
556
#_(with-cache (do (Thread/sleep 4200 ) 42 ))
554
557
555
558
(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]]. "
557
560
[name expr]
558
561
`(let [result# (-> ~(v/->edn expr) eval/eval-string :blob->result first val :nextjournal/value )]
559
562
(def ~name result #)))
Original file line number Diff line number Diff line change 472
472
%)
473
473
presented-result)))
474
474
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
+ []
476
478
(:default @!viewers default-viewers ))
477
479
478
480
(defn datafy-scope [scope]
982
984
{:name `vega-lite-viewer :render-fn 'nextjournal.clerk.render/render-vega-lite :transform-fn mark-presented})
983
985
984
986
(def markdown-viewer
987
+ " A clerk viewer for rendering markdown. See also [[nextjournal.clerk/md]]."
985
988
{:name `markdown-viewer
986
989
:add-viewers markdown-viewers
987
990
:transform-fn (fn [wrapped-value]
You can’t perform that action at this time.
0 commit comments