Liking cljdoc? Tell your friends :D

emmy.clerk

Clerk-specific utilities for configuring Emmy-Viewers.

Use:

Clerk-specific utilities for configuring Emmy-Viewers.

Use:

- [[install-css!]] for project configuration (or use [[serve!]], [[halt!]]
  and [[build!]] in place of the Clerk versions)

- [[install!]] for notebook-specific configuration
raw docstring

->TeXclj/s

(->TeX expr & {:keys [simplify?]})

Convert the given expression to TeX format and return a form that renders as TeX via Clerk.

Optionally takes a key :simplify?; if true, renders a simplified form, else renders the original input.

Convert the given expression to TeX format and return a form that renders as
TeX via Clerk.

Optionally takes a key `:simplify?`; if true, renders a simplified form, else
renders the original input.
sourceraw docstring

build!clj

(build! opts)

Version of [[nextjournal.clerk/build!]] that swaps out the default JS bundle for a custom Emmy-Viewers bundle and makes sure that all custom CSS for emmy-viewers plugins is available during the build.

In addition to all options supported by Clerk's build!, build! supports the following options:

  • :cljs-namespaces: a sequence of CLJS namespaces to compile and make available to Clerk. If provided, build! will compile a custom CLJS bundle and configure Clerk to use this bundle instead of its default. Defaults to nil.

  • :custom-js: custom JS bundle to use instead of Emmy's built-in JS.

  • :cname: string denoting the custom hostname from which the site will be served. If provided, build! will create a CNAME file containing the value in (:out-path opts). Defaults to nil.

The only other difference is that build! populates :git/sha if it hasn't been provided.

All remaining opts are forwarded to [[nextjournal.clerk/build!]]

Version of [[nextjournal.clerk/build!]] that swaps out the default JS
bundle for a custom Emmy-Viewers bundle and makes sure that all custom CSS for
emmy-viewers plugins is available during the build.

In addition to all options supported by Clerk's `build!`, [[build!]] supports
the following options:

- `:cljs-namespaces`: a sequence of CLJS namespaces to compile and make
  available to Clerk. If provided, [[build!]] will compile a custom CLJS bundle
  and configure Clerk to use this bundle instead of its default. Defaults to
  `nil`.

- `:custom-js`: custom JS bundle to use instead of Emmy's built-in JS.

- `:cname`: string denoting the custom hostname from which the site will be
  served. If provided, [[build!]] will create a `CNAME` file containing the
  value in `(:out-path opts)`. Defaults to `nil`.

The only other difference is that [[build!]] populates `:git/sha` if it hasn't
been provided.

All remaining `opts` are forwarded to [[nextjournal.clerk/build!]]
sourceraw docstring

custom-jsclj/s

CDN address of a pre-built JS bundle for Clerk with support for all of this library's viewers.

CDN address of a pre-built JS bundle for Clerk with support for all of this
library's viewers.
sourceraw docstring

halt!clj

(halt!)

Version of [[nextjournal.clerk/halt!]] that additionally kills any shadow-cljs processes, if they are running, and resets all custom CSS entries.

Version of [[nextjournal.clerk/halt!]] that additionally kills any shadow-cljs
processes, if they are running, and resets all custom CSS entries.
sourceraw docstring

inspect-stateclj/s

(inspect-state sym)

Given some symbol representing a client-side Reagent atom, returns a Reagent snippet that will use Clerk's inspect functionality on the dereferenced contents of the atom.

Given some symbol representing a client-side Reagent atom, returns a Reagent
snippet that will use Clerk's `inspect` functionality on the dereferenced
contents of the atom.
sourceraw docstring

install!clj/s

(install! & viewers)

Calling this function at the top of a Clerk notebook installs all appropriate default viewers for Emmy, along with any viewers supplied to install!.

install! is required for any Mafs, MathBox etc code to render correctly.

Calling this function at the top of a Clerk notebook installs all appropriate
default viewers for Emmy, along with any `viewers` supplied to [[install!]].

[[install!]] is required for any Mafs, MathBox etc code to render correctly.
sourceraw docstring

install-css!clj

(install-css!)
(install-css! packages)

Calling this function once will configure Clerk to install the CSS for all Emmy-Viewers dependencies into each Clerk page's header.

Pass a subset (or the full set!) of plugins to install a more limited set of CSS files.

Calling this function once will configure Clerk to install the CSS for all
Emmy-Viewers dependencies into each Clerk page's header.

Pass a subset (or the full set!) of [[plugins]] to install a more limited set
of CSS files.
sourceraw docstring

literal-viewerclj/s

Default viewer for [[emmy.expression/literal?]] objects.

These are rendered by unwrapping their type layer, so that Clerk can use its defaults for things like ratio.s

Default viewer for [[emmy.expression/literal?]] objects.

These are rendered by unwrapping their type layer, so that Clerk can use its
defaults for things like ratio.s
sourceraw docstring

meta-viewerclj/s

Catch-all viewer that allows a metadata-carrying object to specify its viewer via the :nextjournal.clerk/viewer slot metadata.

This viewer can be either a:

  • symbol referencing a viewer's name
  • a viewer object
  • a transform function

In the latter case, the transform will be applied to the value and the result will be rendered instead.

Catch-all viewer that allows a metadata-carrying object to specify its viewer
via the `:nextjournal.clerk/viewer` slot metadata.

This viewer can be either a:

- symbol referencing a viewer's name
- a viewer object
- a transform function

In the latter case, the transform will be applied to the value and the result
will be rendered instead.
sourceraw docstring

multiclj/s

(multi xs)

Given either

  • A map of label => value
  • A sequence of pairs of the form [label, value]

returns a form that will render in Clerk as a tabbed interface, where clicking the tab assigned to a label will replace the space below with the corresponding value.

Use the second form if you care about the order of your tabs.

Given either

- A map of label => value
- A sequence of pairs of the form `[label, value]`

returns a form that will render in Clerk as a tabbed interface, where clicking
the tab assigned to a label will replace the space below with the
corresponding value.

Use the second form if you care about the order of your tabs.
sourceraw docstring

multiviewerclj/s

Viewer that applies to Emmy literals by default and presents them with a tabbed interface showing TeX and the original representation, simplified and unsimplified.

NOTE: In its current state multiviewer doesn't apply to anything but literals, but COULD be activated for anything that responds to [[emmy.env/->TeX]].

Viewer that applies to Emmy literals by default and presents them with a tabbed
interface showing TeX and the original representation, simplified and
unsimplified.

NOTE: In its current state [[multiviewer]] doesn't apply to anything but
literals, but COULD be activated for anything that responds
to [[emmy.env/->TeX]].
sourceraw docstring

pluginsclj/s

Set of all plugins allowed by install-css!.

Set of all plugins allowed by [[install-css!]].
sourceraw docstring

reagent-viewerclj/s

This viewer applies to forms that represent quoted Reagent bodies (which might use functions like reagent.core/with-let or third-party components, not just Hiccup syntax).

The Reagent body is treated as the body of a Clerk viewer's :render-fn.

This viewer applies to forms that represent quoted Reagent bodies (which might
use functions like `reagent.core/with-let` or third-party components, not just
Hiccup syntax).

The Reagent body is treated as the body of a Clerk viewer's `:render-fn`.
sourceraw docstring

serve!clj

(serve!)
(serve! opts)

Version of [[nextjournal.clerk/serve!]] that swaps out the default JS bundle for a custom Emmy-Viewers bundle and installs all custom CSS for emmy-viewers plugins.

In addition to all options supported by Clerk's serve!, serve! supports the following options:

  • :cljs-namespaces: a sequence of CLJS namespaces to compile and make available to Clerk. If provided, serve! will compile a custom CLJS bundle and configure Clerk to use this bundle instead of the Emmy-Viewers bundle.

  • :custom-js: custom JS bundle to use instead of Emmy's JS.

  • :shadow-options: these options are forwarded to [[mentat.clerk-utils.build.shadow/watch!]]. See that function's docs for more detail.

    This bundle is served from a running shadow-cljs server and recompiled when any dependency or namespace changes. Defaults to nil.

The only other difference is that if (:browse? opts) is true, serve! calls [[nextjournal.clerk/show!]] automatically on (:index opts) if provided.

All remaining opts are forwarded to [[nextjournal.clerk/serve!]].

Version of [[nextjournal.clerk/serve!]] that swaps out the default JS
bundle for a custom Emmy-Viewers bundle and installs all custom CSS for
emmy-viewers plugins.

In addition to all options supported by Clerk's `serve!`, [[serve!]] supports
the following options:

- `:cljs-namespaces`: a sequence of CLJS namespaces to compile and make
  available to Clerk. If provided, [[serve!]] will compile a custom CLJS bundle
  and configure Clerk to use this bundle instead of the Emmy-Viewers bundle.

- `:custom-js`: custom JS bundle to use instead of Emmy's JS.

- `:shadow-options`: these options are forwarded
  to [[mentat.clerk-utils.build.shadow/watch!]]. See that function's docs for
  more detail.

  This bundle is served from a running shadow-cljs server and recompiled when
  any dependency or namespace changes. Defaults to `nil`.

The only other difference is that if `(:browse? opts)` is `true`, [[serve!]]
calls [[nextjournal.clerk/show!]] automatically on `(:index opts)` if
provided.

All remaining `opts` are forwarded to [[nextjournal.clerk/serve!]].
sourceraw docstring

tabbed-viewerclj/s

Clerk viewer for showing values in a tabbed interface. Use this viewer with

  • A map of label => value
  • A sequence of pairs of the form [label, value]

Use the second form if you care about the order of your tabs.

Clerk viewer for showing values in a tabbed interface. Use this viewer with

- A map of label => value
- A sequence of pairs of the form `[label, value]`

Use the second form if you care about the order of your tabs.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close