Liking cljdoc? Tell your friends :D

fr.jeremyschoffen.prose.alpha.compilation.core

Api providing generic compilation utilities.

Api providing generic compilation utilities.
raw docstring

*compilation-out*clj/s

Dynamic var that must be bound to an implementation of the Output protocol. It is used as the output of the emit! function.

Dynamic var that must be bound to an implementation of the [[Output]] protocol. It is used as the output
of the [[emit!]] function.
raw docstring

*implementation*clj/s

Map containing the default functions of a compiler implementation.

It has 4 keys:

  • :name: the name of the implementation (a keyword)
  • :default-emit-str!: function that compiles plain text. The escaping logic is intended to live here.
  • :default-emit-tag!: function that compiles a regular tag.
  • :default-emit-special!: function that compiles a special tag

By default this var provides functions that throw exceptions forcing specific implementations to define them.

Map containing the default functions of a compiler implementation.

It has 4 keys:
- `:name`: the name of the implementation (a keyword)
- `:default-emit-str!`: function that compiles plain text. The escaping logic is intended to live here.
- `:default-emit-tag!`: function that compiles a regular tag.
- `:default-emit-special!`: function that compiles a special tag

By default this var provides functions that throw exceptions forcing specific implementations to
define them.
raw docstring

bind-outputcljmacro

(bind-output out & body)

Bind *compilation-out* to out and execute body in this environment.

Bind [[*compilation-out*]] to `out` and execute `body` in this environment.
raw docstring

emit!clj/s

(emit! & args)

Emit text to *compilation-out*.

args are emitted in sequence, nil values are discarded.

Emit text to [[*compilation-out*]].

`args` are emitted in sequence, nil values are discarded.
raw docstring

emit-doc!clj/s

(emit-doc! node)

Emit a document to *compilation-out*. The *implementation* also needs to be bound.

Emit a document to [[*compilation-out*]].
The [[*implementation*]] also needs to be bound.
raw docstring

emit-seq!clj/s

(emit-seq! ss)

emit-special!clj/smultimethod

Generic emit-special! function using the specific implementation from *implementation* by default.

This function dispatches on a pair of value constructed like this: [(:name *implementation*) (:type node)], node being a map, the only argument of the function.

Generic emit-special! function using the specific implementation from [[*implementation*]]
by default.

This function dispatches on a pair of value constructed like this:
`[(:name *implementation*) (:type node)]`, `node` being a map, the only argument of the function.
raw docstring

emit-str!clj/s

(emit-str! s)

Generic emit! function using the specific implementation from *implementation*.

Generic emit! function using the specific implementation from [[*implementation*]].
raw docstring

emit-tag!clj/smultimethod

Generic emit-tag! function using the specific implementation from *implementation* by default.

This function dispatches on a pair of value constructed like this: [(:name *implementation*) (:tag node)], node being a map, the only argument of the function.

Generic emit-tag! function using the specific implementation from [[*implementation*]]
by default.

This function dispatches on a pair of value constructed like this:
`[(:name *implementation*) (:tag node)]`, `node` being a map, the only argument of the function.
raw docstring

Outputclj/sprotocol

append!clj/s

(append! this text)

text-environmentcljmacro

(text-environment & body)

Binds *compilation-out* to a stringbuilder using text-output

Binds [[*compilation-out*]] to a stringbuilder using [[text-output]]
raw docstring

text-outputclj/s≠

(text-output)
clj

Create a text output intended to be a possible binding for *compilation-out* using a java java.lang.StringBuilder.

Create a text output intended to be a possible binding for [[*compilation-out*]] using
a java `java.lang.StringBuilder`.
cljs

Create a text output intended to be a possible binding for *compilation-out* using a goog.string StringBuffer.

Create a text output intended to be a possible binding for [[*compilation-out*]] using
a `goog.string StringBuffer`.
raw docstring

with-implementationcljmacro

(with-implementation i & body)

Binds the dynamic var *implementation* to i.

See *implementation* for specifics.

Binds the dynamic var [[*implementation*]] to `i`.

See [[*implementation*]] for specifics.
raw docstring

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

× close