diff --git a/src/nextjournal/clerk/viewer.cljc b/src/nextjournal/clerk/viewer.cljc index 5512c55dc..149b70c52 100644 --- a/src/nextjournal/clerk/viewer.cljc +++ b/src/nextjournal/clerk/viewer.cljc @@ -868,6 +868,17 @@ (def mathjax-viewer {:name `mathjax-viewer :render-fn 'nextjournal.clerk.render/render-mathjax :transform-fn mark-presented}) +(def meta-viewer + {:name `meta-viewer + :pred (comp (some-fn fn? map?) :nextjournal.clerk/viewer meta) + :transform-fn + (update-val + (fn [v] + (let [viewer (-> v meta :nextjournal.clerk/viewer)] + (if (fn? viewer) + (viewer v) + (with-viewer viewer v)))))}) + (defn ->opts [wrapped-value] (select-keys wrapped-value [:nextjournal/budget :nextjournal/css-class :nextjournal/width :nextjournal/opts :nextjournal/render-evaluator @@ -1193,6 +1204,7 @@ elision-viewer katex-viewer mathjax-viewer + meta-viewer html-viewer plotly-viewer vega-lite-viewer