(add-op! n f)
Meant to be used primarily by defop
.
Meant to be used primarily by `defop`.
(column-table s {:keys [labels sep rows] :as t} {:keys [assign exec asserts]})
Take a table of data and assert a bunch of stuff on it. The
assign
map should contain mappings from labels in the table to
keys they should be mapped to in the s
collection. The exec
should be
a single function to be executed for each row. It will receive the
current state after having all the assignments made. It should return
the state to be passed to the assertions, and eventually, the next row.
Finally, the assert
should contain yet another map of labels to keys in the
state that should match.
Take a table of data and assert a bunch of stuff on it. The `assign` map should contain mappings from labels in the table to keys they should be mapped to in the `s` collection. The `exec` should be a single function to be executed for each row. It will receive the current state after having all the assignments made. It should return the state to be passed to the assertions, and eventually, the next row. Finally, the `assert` should contain yet another map of labels to keys in the state that should match.
(defop n [s] & body)
Defines an operation that can be executed in your document. Accepts a
name (n
) that will be referred to in brackets. The body will be of a
function that accepts a single parameter s
. That parameter will be filled
in with the current state of the running tests.
Your operation must return whatever parts of s
your operation wishes to
pass on to future operations and/or assertions.
Defines an operation that can be executed in your document. Accepts a name (`n`) that will be referred to in brackets. The body will be of a function that accepts a single parameter `s`. That parameter will be filled in with the current state of the running tests. Your operation *must* return whatever parts of `s` your operation wishes to pass on to future operations and/or assertions.
(deftfn n [s t] & body)
Defines a table processing function. Accepts a name (n
) that will be
referred to in brackets in the table's legend. The body will be of a
function that accepts two parameters: s
, the current state of the running
tests, and t
, a structure containing the parsed table structure.
Your operation must return a vector containing an updated [s
t
]. The
value of s
will be sent to the next operation, whereas t
will be
re-constituted into a table and inserted into the markdown stream.
Defines a table processing function. Accepts a name (`n`) that will be referred to in brackets in the table's legend. The body will be of a function that accepts two parameters: `s`, the current state of the running tests, and `t`, a structure containing the parsed table structure. Your operation must return a vector containing an updated [`s` `t`]. The value of `s` will be sent to the next operation, whereas `t` will be re-constituted into a table and inserted into the markdown stream.
(execute-asciidoc initial-state in out-stream)
Parse an Asciidoc document on in
that contains bindings, assertions, and/or
operations, executing them, and writing the modified markdown into the given
out-stream
.
Parse an Asciidoc document on `in` that contains bindings, assertions, and/or operations, executing them, and writing the modified markdown into the given `out-stream`.
(execute-markdown initial-state in out-stream)
Parse a Markdown document on in
that contains bindings, assertions, and/or
operations, executing them, and writing the modified markdown into the given
out-stream
.
Parse a Markdown document on `in` that contains bindings, assertions, and/or operations, executing them, and writing the modified markdown into the given `out-stream`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close