Skip to content

Commit c3f58e1

Browse files
committed
fix notebook
1 parent fd2c985 commit c3f58e1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The transformation of markdown node types can be customised like this:
9090

9191
```clojure
9292
^{:nextjournal.clerk/viewer 'nextjournal.clerk.viewer/html-viewer}
93-
(md->hiccup
93+
(md/->hiccup
9494
(assoc md.transform/default-hiccup-renderers
9595
;; :doc specify a custom container for the whole doc
9696
:doc (partial md.transform/into-markup [:div.viewer-markdown])
@@ -106,15 +106,16 @@ The transformation of markdown node types can be customised like this:
106106
Typically you'd want to customize the rendering of `:html-inline` and `:html` since these need to be rendered to raw strings:
107107

108108
``` clojure
109+
(require '[hiccup2.core :as hiccup])
110+
109111
(def renderers
110112
(assoc md.transform/default-hiccup-renderers
111113
:html-inline (comp hiccup/raw md.transform/->text)
112114
:html-block (comp hiccup/raw md.transform/->text)))
113115

114-
(md/->hiccup renderers "<img src=\"...\"/>)
116+
(md/->hiccup renderers "<img src=\"...\"/>")
115117

116-
(str (hiccup/html (md/->hiccup renderers "<img src=\"...\"/>)")))
117-
;;=> "<div><p><img src=\"...\"/>)</p></div>"
118+
(str (hiccup/html (md/->hiccup renderers "<img src=\"...\"/>")))
118119
```
119120

120121
We've built hiccup transformation in for convenience, but the same approach can be used to target [more formats](https://nextjournal.github.io/markdown/notebooks/pandoc).

0 commit comments

Comments
 (0)