(example->html {:keys [type prod? static?], :as state} {:keys [id doc body-str with-card], :as example})
Source
(rum/defc example->html < {:after-render init-example-editor}
[{:keys [type prod? static?] :as state}
{:keys [id doc body-str with-card] :as example}]
(when-let [html (try
(hs/code->html body-str)
(catch #?(:clj Exception :cljs js/Error) _))]
(let [hide-instarepl? (or (and (= type :cljs) prod?)
(and (= type :clj) static?))]
[:div {:class "section"}
[:div {:class "section doc"} doc]
(when (and with-card (not hide-instarepl?))
[:div {:class "card" :id id}])
[:div {:class "paren-soup"}
[:div {:class "instarepl"
:style {:display (if hide-instarepl? "none" "list-item")}}]
[:div {:class "content"
:dangerouslySetInnerHTML {:__html html}}]]])))