Changes can be:
🌟 Simplify viewer api by letting :transform-fn
act on wrapped-value (#152)
This simplifies the viewer api by letting :transform-fn
act on
the wrapped-value. This way the :transform-fn
can now serve as the
single JVM-extension point and also serve as :fetch-fn
(using
mark-presented
) and :update-viewers-fn
.
In the case of a :fetch-fn
the transformation would previously
happen in a second pass. Now it is always eager, which should make it
much clearer what's happening.
Also do a naming pass:
describe
→ present
merge-descriptions
→ merge-presentations
⭐️ Extend the reach of the viewer api to the root node.
This allows full customization of how a Clerk doc is displayed. Showcase that by implementing a slideshow viewer.
⭐️ Show render-fn errors and simplify and improve default viewers
Show a somewhat useful error when a viewer's :render-fn
errors, either on eval or when invoked as a render function later. Since the stack property of js/Error
isn't standardized the usefulness differs between browsers and variants. The advanced compiled js bundle is currently lacking source maps so the stack isn't useful there, yet.
Also simplify and improve the default viewers by having a fallback reader function for unknown tags and display anything that's readable with it using the pagination inside the browser. We can use this as a generic fallback and drop a number of specialised viewers (uuid?
, fn?
, inst?
). It also means Clerk will now display these fallback objects identical to how Clojure will print them. Note that this also means that bringing in library like cider.nrepl that extends print-method
will affect how things are displayed in Clerk.
Lastly, we include a viewer for clojure.lang.IDeref
that will use Clerk's JVM-side pagination behaviour for the :val
.
More rationale and live examples in the Better Printing ADR notebook.
💫 Refactor analysis to support multiple defs per top-level form (#159)
🐜 Make no-cache on side-effecting var invalidate dependents (#158), fixes #157
🐞 Fix lazy loading when viewer is selected via metadata.
🐞 Perform bounded count limit check on tree (#154)
Previously this would only be performed on the root node so we'd go out of
memory attempting to cache a value like {:a (range)}
.
🛠 Update SCI & SCI configs (#151)
🛠 Start Clerk on bb dev
after first cljs compile and forward serve opts.
^:nextjournal.clerk/toc
metadata on ns form.build-static-app!
(#130)not-prose
classclerk/recompute!
for fast recomputation of doc without re-parsing & analysiswith-d3-require
to viewer api, tweak sci read opts (#86)defcached
and with-cache
macros to enable access to Clerk's view of a var or expression respectively.clear-cache!
also clear in memory cache (#100):pred
& :transform-fn
)This release focuses on improving the viewer api:
java.awt.image.BufferedImage
with automatic layouting. These can be easily created constructed from javax.imageio.ImageIO/read
from File
, URL
or InputStream
.html
or table
viewers.:nextjournal.clerk/viewer
to convey the viewer. Valid values are viewer functions or keywords. The latter is useful when you don't want a runtime dependency on Clerk. (#58):render-fn
must now be quoted to make it clearer it doesn't run on the JVM but in the browser (#53):nextjournal.clerk/width
with valid values :full
, :wide
or :prose
. (#53)build-static-app!
on windows (#39):transform-fn
that allows a transformation of a value in JVM Clojure. Also rename :fn
to :render-fn
for clarify and ensure the :pred
only runs on JVM Clojure to enable using predicates that cannot run in sci in the browser. Add support for serving arbitrary blobs via a :fetch-fn
that returns a map with :nextjournal/content-type
and nextjournal/value
keys (example).v/clerk-eval
to the viewer api which takes a quoted form and evaluates it in the context of the document namespace.:nextjournal.clerk/visibility
metadata on a form. Valid values are: :show
(default) :fold
or :hide
. These settings can be set on individual forms, setting them on the ns
form changes the default for all forms in the document. If you want to affect only the ns
form, use :fold-ns
or :hide-ns
(example).config/*in-clerk*
that is only true when Clerk is driving evaluation.pr-str
viewer*bounded-count-limit*
#15.show!
in a notebook using config/*in-clerk*
.scm
information to pom.xml
:nextjournal.clerk/no-cache
on namespacesfetch
. This let's Clerk handle moderately sized datasets without breaking a sweat.clerk/serve!
function as main entry point, this allows pinning of notebooks->table
hack and use default viewers for sqlmaybe->fn+form
to ensure it doesn't happen twice->edn
from non clojure-walkable structuresbuild-static-html!
when out dirs don't existclerk/clear-cache!
💫 Clerk now runs on Windows.
rewrite-clj
, see clj-commons/rewrite-clj#93👋 First numbered release.
Can you improve this documentation? These fine people already did:
Martin Kavalar & Philippa MarkovicsEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close