Skip to content

Commit

Permalink
Fix cards notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
mk committed Feb 8, 2023
1 parent 1b5bf5e commit ff30d54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions notebooks/cards.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
^{:nextjournal.clerk/toc true :nextjournal.clerk/visibility {:code :hide}}
(ns cards
{:nextjournal.clerk/no-cache true}
(:require [nextjournal.clerk :as clerk]
[cards-macro :as c]
[nextjournal.clerk.viewer :as v]))
(:require
[applied-science.js-interop :as-alias j]
[reagent.core :as-alias reagent]
[cards-macro :as c]
[nextjournal.clerk :as clerk]
[nextjournal.clerk.viewer :as v]))

;; ## Images
(c/card
Expand Down Expand Up @@ -195,7 +198,7 @@
;; ## Parser API

^{::clerk/width :wide}
(c/card
(c/card
(as-> ";; # 👋 Hello CLJS
;; This is `fold`
;;
Expand All @@ -209,12 +212,12 @@
(fold str \"\" (range 10))
;; ## And the usual Clerk's perks
(v/plotly {:data [{:y (shuffle (range 10)) :name \"The Federation\"}
(nextjournal.clerk.viewer/plotly {:data [{:y (shuffle (range 10)) :name \"The Federation\"}
{:y (shuffle (range 10)) :name \"The Empire\"}]})
;; tables
(v/table {:a [1 2 3] :b [4 5 6]})
(nextjournal.clerk.viewer/table {:a [1 2 3] :b [4 5 6]})
;; html
(v/html [:h1 \"🧨\"])
(nextjournal.clerk.viewer/html [:h1 \"🧨\"])
"
doc
(nextjournal.clerk.parser/parse-clojure-string {:doc? true} doc)
Expand Down
2 changes: 1 addition & 1 deletion notebooks/cards_macro.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns cards-macro
(:require [nextjournal.clerk.viewer :as v]))

(defmacro card [body] `(v/->viewer-eval '~body))
(defmacro card [body] `(v/->viewer-eval '~(v/resolve-aliases body)))

0 comments on commit ff30d54

Please sign in to comment.