Clerk takes a Clojure namespace and turns it into a notebook:
Computational notebooks allow arguing from evidence by mixing prose with executable code. For a good overview of problems users encounter in traditional notebooks like Jupyter, see I don't like notebooks and What’s Wrong with Computational Notebooks? Pain Points, Needs, and Design Opportunities.
Specifically Clerk wants to address the following problems:
Clerk is a notebook library for Clojure that aims to address these problems by doing less, namely:
ALPHA, expect breaking changes.
To use Clerk in your project, add the following dependency to your deps.edn
:
{:deps {io.github.nextjournal/clerk {:mvn/version "0.2.214"}}}
Require and start Clerk as part of your system start, e.g. in user.clj
:
(require '[nextjournal.clerk :as clerk])
;; start Clerk's buit-in webserver on the default port 7777, opening the browser when done
(clerk/serve! {:browse? true})
;; either call `clerk/show!` explicitly
(clerk/show! "notebooks/rule_30.clj")
;; or let Clerk watch the given `:paths` for changes
(clerk/serve! {:watch-paths ["notebooks" "src"]})
;; start with watcher and show filter function to enable notebook pinning
(clerk/serve! {:watch-paths ["notebooks" "src"] :show-filter-fn #(clojure.string/starts-with? % "notebooks")})
You can then access Clerk at http://localhost:7777.
See the /notebooks folder in the Clerk repository for a number of sample notebooks.
Make sure you have Babashka installed, and run:
bb dev
The will start everything needed to develop Clerk. You can connect your favorite editor to it using nREPL.
Can you improve this documentation? These fine people already did:
Martin Kavalar & Davide TavianiEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close