Liking cljdoc? Tell your friends :D

book-report.core


->seqclj

(->seq form)

Checks if form is a sequence otherwise makes a sequence

Checks if form is a sequence otherwise makes a sequence
sourceraw docstring

appendclj

(append item list)
(append f item list)

Appends an item to a list. Takes an optional formatter function, the new item, and a list. Suitable for list thread macros. Returns a vector with item appended to end of list.

Appends an item to a list.
Takes an optional formatter function, the new item, and a list.
Suitable for list thread macros.
Returns a vector with item appended to end of list.
sourceraw docstring

append-strclj

(append-str substr s)

Takes a partial string and aggregate string. Returns aggregate string with partial string appended to end.

Takes a partial string and aggregate string.
Returns aggregate string with partial string appended to end.
sourceraw docstring

build-outputclj

(build-output [form & remaining :as forms] output)

Builds up the output to return from the lesson macro. Takes a list of forms provided to the lesson. Returns a list of remaining forms to process and updated output.

Builds up the output to return from the lesson macro.
Takes a list of forms provided to the lesson.
Returns a list of remaining forms to process and updated output.
sourceraw docstring

displayclj

(display output & form-lists)

Takes a vector of forms to evaluate and a list of forms to append. Returns a vector of forms with new lists conjoined to the end.

Takes a vector of forms to evaluate and a list of forms to append.
Returns a vector of forms with new lists conjoined to the end.
sourceraw docstring

eval-form?clj

(eval-form? form)

Determine if a form is a special case form used by the lesson macro. If it is then return false otherwise return true for normal cojure forms. Used to group eval statements between notes, title, or run forms Takes a clojure form list Returns true or false.

Determine if a form is a special case form used by the lesson macro. If it is
then return false otherwise return true for normal cojure forms.
Used to group eval statements between notes, title, or run forms
Takes a clojure form list
Returns true or false.
sourceraw docstring

eval-strclj

(eval-str form)

Takes a form expression. Returns a list of [output-str, return-value].

Takes a form expression.
Returns a list of [output-str, return-value].
sourceraw docstring

format-codeclj

(format-code forms)

Formats each form as an intented list of strings. Takes a list of forms to print. Returns a list of clojure forms to print the forms as a single code string.

Formats each form as an intented list of strings.
Takes a list of forms to print.
Returns a list of clojure forms to print the forms as a single code string.
sourceraw docstring

format-code-linesclj

(format-code-lines lines)

Format code forms as 2-space indented strings. Takes a list of forms. Returns list of strings.

Format code forms as 2-space indented strings.
Takes a list of forms.
Returns list of strings.
sourceraw docstring

format-evalclj

(format-eval forms)

Formats a form to be captured and evaluated later at run time. Takes a list of forms to evaluate. Returns a list of forms to evaluate and format the output from the forms.

Formats a form to be captured and evaluated later at run time.
Takes a list of forms to evaluate.
Returns a list of forms to evaluate and format the output from the forms.
sourceraw docstring

format-eval-resultsclj

(format-eval-results form)

Evaluates forms, captures output, and aligns it to the indented eval column. Takes a list of form expressions. Returns list of clojure forms to print code evaluation results.

Evaluates forms, captures output, and aligns it to the indented eval column.
Takes a list of form expressions.
Returns list of clojure forms to print code evaluation results.
sourceraw docstring

format-noteclj

(format-note [note & lines])

Align notes vertically. Takes a list of strings. Returns a list of strings.

Align notes vertically.
Takes a list of strings.
Returns a list of strings.
sourceraw docstring

format-notesclj

(format-notes notes)

Takes a list of notes and formats them so that newlines are aligned vertically and separate notes are prefixed with a - (dash). Returns sequence of clojure forms to print list of notes.

Takes a list of notes and formats them so that newlines
are aligned vertically and separate notes are prefixed with a - (dash).
Returns sequence of clojure forms to print list of notes.
sourceraw docstring

format-outputclj

(format-output forms)

Takes a vector of forms. Returns a form to run a sequence of forms.

Takes a vector of forms.
Returns a form to run a sequence of forms.
sourceraw docstring

format-returnclj

(format-return return-value lines)

Format the return value based on the number of lines. Takes a return value string and lines of output. Returns string of output lines followed by return value.

Format the return value based on the number of lines.
Takes a return value string and lines of output.
Returns string of output lines followed by return value.
sourceraw docstring

format-titleclj

(format-title titles)

Display a title indented with 2 spaces and an underline. Takes a list of title strings. Returns list of clojure forms to print the title.

Display a title indented with 2 spaces and an underline.
Takes a list of title strings.
Returns list of clojure forms to print the title.
sourceraw docstring

lessoncljmacro

(lesson chapter title & forms)

Render code and its output grouped as a lesson from a chapter. Takes a chapter name, title string, notes, and code forms. Returns a list of expressions to display it nicely. (lesson 1 "Calling functions" (title "Addition example") (notes "Should return 2") (run (def add +)) (add 1 1))

Render code and its output grouped as a lesson from a chapter.
Takes a chapter name, title string, notes, and code forms.
Returns a list of expressions to display it nicely.
(lesson 1
        "Calling functions"
        (title "Addition example")
        (notes "Should return 2")
        (run (def add +))
        (add 1 1))
sourceraw docstring

prepend-strclj

(prepend-str substr s)

Takes a partial string and aggregate string. Returns partial string prepended to beginning of aggregate string.

Takes a partial string and aggregate string.
Returns partial string prepended to beginning of aggregate string.
sourceraw docstring

process-internal-formclj

(process-internal-form form)

Process a form if it contains an internal form such as notes, run, or title. Takes a form like '(+ 1 2) Returns a list of forms to evaluate.

Process a form if it contains an internal form such as notes, run, or title.
Takes a form like `'(+ 1 2)`
Returns a list of forms to evaluate.
sourceraw docstring

process-standard-formsclj

(process-standard-forms forms output)

Handles standard clojure evaluation forms within a lesson. This allows the user to specify (lesson 1 "title" (def x 1) (+ x 1)). Takes a list of forms, some may be internal forms. Returns a vector of remaining forms to process and updated output.

Handles standard clojure evaluation forms within a lesson.
This allows the user to specify (lesson 1 "title"
                                          (def x 1)
                                          (+ x 1)).
Takes a list of forms, some may be internal forms.
Returns a vector of remaining forms to process and updated output.
sourceraw docstring

run-codeclj

(run-code forms)

Takes a list of forms and wraps it in a list of do commands. Takes a list of expression forms Returns list of symbols to eval later.

Takes a list of forms and wraps it in a list of do commands.
Takes a list of expression forms
Returns list of symbols to eval later.
sourceraw docstring

space-code-blocksclj

(space-code-blocks code-str block)

Groups code blocks based on line-count. If a code block is a single line then space them out with a single line. If a code block spans multiple lines, space the code block with two lines. Kind of like a conditional (clojure.string/join " " coll) Takes the aggregate code string and the next block of code string. Returns the aggregate code string.

Groups code blocks based on line-count. If a code block is a single line then
  space them out with a single line.
  If a code block spans multiple lines, space the code block with two lines.
  Kind of like a conditional (clojure.string/join "
" coll)
  Takes the aggregate code string and the next block of code string.
  Returns the aggregate code string.
sourceraw docstring

with-out-str-and-valuecljmacro

(with-out-str-and-value & body)

Similar to with-out-str but returns list of output and return value. Takes body expression forms. Returns vector [output-str, return-value].

Similar to with-out-str but returns list of output and return value.
Takes body expression forms.
Returns vector [output-str, return-value].
sourceraw docstring

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

× close