This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-02
Channels
- # announcements (25)
- # babashka (76)
- # beginners (74)
- # biff (36)
- # calva (11)
- # cider (5)
- # clerk (43)
- # cljs-dev (4)
- # cljsrn (12)
- # clojure (111)
- # clojure-austin (14)
- # clojure-europe (82)
- # clojure-nl (2)
- # clojure-norway (5)
- # clojure-uk (1)
- # clojurescript (36)
- # core-async (13)
- # cursive (30)
- # datomic (12)
- # fulcro (6)
- # honeysql (9)
- # hyperfiddle (73)
- # instaparse (3)
- # introduce-yourself (1)
- # membrane (40)
- # nbb (2)
- # off-topic (6)
- # other-languages (9)
- # polylith (33)
- # reagent (2)
- # reitit (7)
- # rum (7)
- # shadow-cljs (47)
- # tools-deps (10)
- # vim (11)
- # xtdb (16)
I wonder if there's an easy way to make a Clerk notebook render somewhat like a Keynote presentation (one "page" at a time, with forward and back buttons)? I'm working on a tutorial that could benefit from that.
I think @mkvlr did get that working!
Haha that’s how you know they’re good!!! Also the feature isn’t done yet (I think?) so it’s a good thing to bring up. I want it badly for my clojure conj talk
@hlship see https://github.com/nextjournal/clerk-slideshow by @andrea712 and @philippmarkovics.
Just released io.github.nextjournal/clerk {:mvn/version "0.13.838"}
• 📄 https://github.com/nextjournal/clerk/blob/b149f2f34370125b53acd809c32764f9d6c5a01d/CHANGELOG.md#013838-2023-03-02
• 🪵 https://clojars.org/io.github.nextjournal/clerk/versions/0.13.838
Already using it! First off, I can save a page as PDF, there's still some issues, but at least it's more than one page.
It does save and mostly looks good, but some of the layout ends up with tabular layout on top of text layout.
Some of the most fun I've had coding in the last few months has been in Clerk notebooks!
Shower thought: I spent some time with SQLite yesterday, using https://sqlitebrowser.org/ to see what I was doing. If there was a Clerk-based alternative, I'd probably use that instead. (some-person.clerk-extras/db-browse datasource)
. I think jdbc.next has datafy+nav support for navigating through foreign keys.
Clerk evaluated '/home/.../some.clj' in 39.979623ms.
Execution error (ExceptionInfo) at clojure.tools.analyzer.passes.jvm.validate/eval16782$fn (validate.clj:189).
Wrong tag: clojure.core$double@4e0d541b in def: PI
currently suspect it’s a side-effect of analyzing more code due to build-graph
change from https://github.com/nextjournal/clerk/blob/b149f2f34370125b53acd809c32764f9d6c5a01d/CHANGELOG.md#013838-2023-03-02
The problem is that if I use such symbol (defined in other namespace) I also get this error.
(clojure.tools.analyzer.jvm/analyze '(def ^:const ^double PI 3.14) (clojure.tools.analyzer.jvm/empty-env) {})
Looks to me like the https://blog.nextjournal.com/garden.html#citation-needed link isn't working?
is there a form of clerk/example
that I can use for tests? where the notebook runs an assertion that my output still matches the generated output? I am sure this has been asked
not in clerk currently. Would like to see someone build it and then see if it’s something folks would want in clerk.
for documentation purposes it would be great stuff (`notespace` and my metadoc
supports this)
Having a combined clerk and test suite is something I’m looking for also.
We have built a clerk kaocha test thing internally, it's easy and doesn't take much code. It would be great if community members would give this a try for themselves. 🙂
I think we speak about something slightly different. Kind of embedding tests into the notebook and connect them with examples. Quick and dirty:
(defmacro examples-with-test
[& forms]
`(clerk/table
{:head ["test" "code" "result"]
:rows [~@(for [[c f t] forms
:let [test-code `(clojure.test/is ~(if t `(~f ~c ~t) `(= ~f ~c)))]]
`(let [t# ~test-code]
[(if t# "✅" "❌" ) (clerk/code (quote ~c)) (if t# ~c (str "Expected " ~(or t f) " got " ~c))]))]}))
(examples-with-test
[(+ 1 2) 3]
[(+ 3 4) 5]
[(+ 5 (rand-int 10)) >= 5])
when using clerk/build!
on a single file, can I derive the name of the output file from the input file?
I’d like a way to build individual notebooks without name clashes on index.html
Thinking a bit more about “publication” workflows with Clerk, it would be interesting if you could use metadata on specific forms to display them in interactive mode but exclude them from publication in a static app. That feature would be good for inline assertions/checks like the ones @sritchie09 described that don’t need to be published but should live inside the notebook.