This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-06
Channels
- # adventofcode (2)
- # announcements (5)
- # architecture (4)
- # babashka (35)
- # beginners (28)
- # calva (4)
- # cider (9)
- # clerk (30)
- # clj-kondo (11)
- # clojure (58)
- # clojure-conj (3)
- # clojure-europe (71)
- # clojure-gamedev (2)
- # clojure-nl (3)
- # clojure-uk (2)
- # clojurescript (49)
- # conjure (2)
- # cursive (2)
- # emacs (4)
- # fulcro (1)
- # honeysql (2)
- # hyperfiddle (10)
- # jobs (2)
- # jobs-discuss (18)
- # leiningen (9)
- # membrane (14)
- # missionary (1)
- # off-topic (27)
- # pedestal (1)
- # polylith (5)
- # reagent (12)
- # releases (2)
- # remote-jobs (3)
- # shadow-cljs (83)
- # sql (5)
- # squint (13)
- # tools-build (13)
would you like to set it to full with? That would be {:nextjournal.clerk/width :full}
as a first arg to clerk/plotly
with: ācontainerā, see https://vega.github.io/vega-lite/examples/bar_size_responsive.html
How can I debug a build error with clerk?
Execution error (NullPointerException) at clojure.tools.analyzer.jvm/macroexpand-1 (jvm.clj:192).
Cannot read field "ns" because "sym" is null
(running nextjournal.clerk/build!
)It errored from CLI not from REPL, I'll check later if it reproduces, but the temp edn file produced just showed the stack trace, not the offending form
ok, if you can use a :local/root
dep Iād be curious to know if changing the catch to Throwable
gives you the form https://github.com/nextjournal/clerk/blob/f57d9efe6c70f922ecd715a1f45f799be939c750/src/nextjournal/clerk/analyzer.clj#L138
I managed to narrow it down to: I define a protocol and record in the same file emit-defrecord fails because it can't resolve the protocol
Is there an example config for ClerkShow for neovim lua? (With Conjure)
There's a config example here (third one in the section): https://github.clerk.garden/nextjournal/book-of-clerk/commit/cce3dc46c582dc8f6507c084e773ee9e5df7bd77/#editor-integration
I saw that one, but it was vimscript I was hoping for a lua version.
Ah, sorry, I didn't pay close enough attention! I don't know of one, but if you ask @U38J3881W nicely, they might help you get it working and contribute that recipe to the Book of Clerk š
(module clay-integration.lnvim
{autoload {a aniseed.core
str aniseed.string
nvim aniseed.nvim
eval conjure.eval
extract conjure.extract}})
(defn eval-clojure-for-viz []
(eval.eval-str
{:origin "custom-clay-wrapper"
:code (str.join
""
["(scicloj.clay.v2.api/handle-form! `" (a.get (extract.form {:root? true}) :content) ")"])}))
(defn on-filetype []
(nvim.buf_set_keymap
0 :n "<localleader>ev" ""
{:callback eval-clojure-for-viz}))
(def augroup (nvim.create_augroup :gower-st-intro.lnvim {}))
(nvim.create_autocmd
:Filetype
{:group augroup
:pattern ["clojure"]
:callback on-filetype})
Here's how I integrated Conjure with Clay, probably similar?Oops, realised I made a wiki page for this https://github.com/Olical/conjure/wiki/Integrating-with-Clay-and-data-visualisation-tools
And I know this is an old thread, I just never check clojurians so I thought I'd drop something in here now š I'm only really in github issues and the Conjure discord. https://conjure.fun/discord
Just noticed that there is a difference in size between string and markdown text when rendered in a table. Is it possible to make the same style for both cases?
Hi @U1EP3BZ3Q, this should allow you to customise the string viewer inside tables:
(defn add-child-viewers [viewer viewers]
(update viewer :transform-fn (fn [tx-fn] (comp #(update % :nextjournal/viewers clerk/add-viewers viewers) tx-fn))))
(def custom-table-viewer
(add-child-viewers v/table-viewer
[(assoc v/string-viewer :render-fn '(fn [s] [:pre.text-amber-500 s]))]))
(clerk/with-viewer custom-table-viewer
[["text"]["text"] [(clerk/md "text")]])
then you could check the markup rendered by clerk/md
in the browser and adjust the :render-fn
function to output the same.the example is adjusted from our notebook https://github.com/nextjournal/clerk/blob/f57d9efe6c70f922ecd715a1f45f799be939c750/notebooks/viewers/table.clj#L67-L77
this should get you the same styles:
(defn add-child-viewers [viewer viewers]
(update viewer :transform-fn (fn [tx-fn] (comp #(update % :nextjournal/viewers clerk/add-viewers viewers) tx-fn))))
(def custom-table-viewer
(add-child-viewers nextjournal.clerk.viewer/table-viewer
[(assoc nextjournal.clerk.viewer/string-viewer :render-fn '(fn [s] [:div.markdown-viewer [:p s]]))]))
(clerk/with-viewer custom-table-viewer
[[1 "text"][ 2"text"] [3 (clerk/md "text")]])