Utilities for writing docs and working with Clerk in a project that may or may not have Clerk on the classpath.
Expect this namespace to fission off into more specific namespaces as the catalogue of functions grows.
Utilities for writing docs and working with Clerk in a project that may or may not have Clerk on the classpath. Expect this namespace to fission off into more specific namespaces as the catalogue of functions grows.
(->clerk & body)
If nextjournal.clerk
is present on the classpath, acts as do
for all
supplied code forms in body
. Else, acts like comment
and elides its
arguments.
Like comment
, body must still be written in well-formed Clojure that can be
parsed by the reader.
If `nextjournal.clerk` is present on the classpath, acts as `do` for all supplied code forms in `body`. Else, acts like `comment` and elides its arguments. Like `comment`, body must still be written in well-formed Clojure that can be parsed by the reader.
(->clerk-only & body)
If nextjournal.clerk
is present on the classpath AND Clerk is evaluating
body
, acts as do
for all supplied code forms in body
. Else, acts like
comment
and elides its arguments.
Use this macro to supply examples and forms that should render in a Clerk environment but not affect normal Clojure evaluation in any way.
If `nextjournal.clerk` is present on the classpath AND Clerk is evaluating `body`, acts as `do` for all supplied code forms in `body`. Else, acts like `comment` and elides its arguments. Use this macro to supply examples and forms that should render in a Clerk environment but not affect normal Clojure evaluation in any way.
(cljs & exprs)
Returns a form that executes all exprs
in Clerk's SCI environment and renders
the final form. If the final form evaluates to a vector, the vector is
interpreted as a Reagent component.
Else, the form is presented with [v/inspect form]
. (To present a vector,
manually wrap the final form in [v/inspect ,,,]
.)
If nextjournal.clerk
is not present on the classpath, acts as comment
.
See ->clerk
for more detail.
Returns a form that executes all `exprs` in Clerk's SCI environment and renders the final form. If the final form evaluates to a vector, the vector is interpreted as a Reagent component. Else, the form is presented with `[v/inspect form]`. (To present a vector, manually wrap the final form in `[v/inspect ,,,]`.) If `nextjournal.clerk` is not present on the classpath, acts as `comment`. See [[->clerk]] for more detail.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close