Liking cljdoc? Tell your friends :D
All platforms.

fr.jeremyschoffen.prose.alpha.document.common.evaluator

Generic API providing document evaluation utilities.

Generic API providing document evaluation utilities.
raw docstring

eval-docclj/s

(eval-doc {:prose.alpha.document/keys [path slurp-doc read-doc eval-forms]
           :as env})

Evaluate a document.

Takes care of binding fr.jeremyschoffen.prose.alpha.eval.common/*evaluation-env* using its parameter.

This function takes one argument which is a map. The keys are as follow:

  • path: a string, the path to the document
  • slurp-doc: a function that takes a path to a file and return the text content of that file
  • read-doc: a reader / parser function, text in, code (data) out
  • eval-forms: an evaluation function, takes a sequence of forms and returns the sequence of evaluations
Evaluate a document.

Takes care of binding [[fr.jeremyschoffen.prose.alpha.eval.common/*evaluation-env*]] using its parameter.

This function takes one argument which is a map. The keys are as follow:
- `path`: a string, the path to the document
- `slurp-doc`: a function that takes a path to a file and return the text content of that file
- `read-doc`: a reader / parser function, text in, code (data) out
- `eval-forms`: an evaluation function, takes a sequence of forms and returns the sequence of evaluations
raw docstring

makeclj/s

(make {slurp-doc :slurp-doc read-doc :read-doc efs :eval-forms})

Make an evaluation function that uses eval-doc under the hood.

Takes a map as an argument with the following keys:

  • :slurp-doc: a function that takes a path to a file and return the text content of that file
  • :read-doc: a reader function, text in, code (data) out
  • :eval-forms: an evaluation function, takes a sequence of forms and returns the sequence of evaluations

Returns a function that takes a path and optionally some input as arguments and returns the evaluated document. The input if present is added to fr.jeremyschoffen.prose.alpha.eval.common/*evaluation-env* under the key :prose.alpha.document/input {} For instance:

(def my-eval-doc
     (make {:slurp-doc sd
            :read-doc read-from-string
            :eval-forms eval-forms}))

(my-eval-doc "path/to/doc" {:some :input})
Make an evaluation function that uses [[eval-doc]] under the hood.

Takes a map as an argument with the following keys:
- `:slurp-doc`: a function that takes a path to a file and return the text content of that file
- `:read-doc`: a reader function, text in, code (data) out
- `:eval-forms`: an evaluation function, takes a sequence of forms and returns the sequence of evaluations

Returns a function that takes a path and optionally some input as arguments and returns the evaluated document.
The input if present is added to [[fr.jeremyschoffen.prose.alpha.eval.common/*evaluation-env*]] under the key
`:prose.alpha.document/input {}`
For instance:
```clojure
(def my-eval-doc
     (make {:slurp-doc sd
            :read-doc read-from-string
            :eval-forms eval-forms}))

(my-eval-doc "path/to/doc" {:some :input})
```
raw docstring

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

× close