Liking cljdoc? Tell your friends :D

fr.jeremyschoffen.prose.alpha.document.lib

Api providing several tools to use inside or outside of prose document.

Api providing several tools to use inside or outside of prose document.
raw docstring

<>clj/s

(<> & content)

Fragment tag whose content is meant to be spliced into its parent's content.

Fragment tag whose content is meant to be spliced into its parent's content.
raw docstring

add-classesclj/s

(add-classes t classes)

attr->setclj/s

(attr->set s)

Turn the string value of an html tag attribute into a set of strings (like the value class attribute).

Turn the string value of an html tag attribute into a set of strings
(like the value class attribute).
raw docstring

conform-or-throwclj/s

(conform-or-throw spec v)

Conforms the value v using the spec spec and throws an ex-info if v is invalid.

Conforms the value `v` using the spec `spec` and throws an `ex-info` if `v` is invalid.
raw docstring

def-sclj/smacro

(def-s & args)

Same as def except that it returns and empty string.

Same as `def` except that it returns and empty string.
raw docstring

def-xml-tagclj/s≠macro

clj
(def-xml-tag name docstring? keyword-name?)
cljs
(def-xml-tag & args)

Helper in making functions that construct tags.

Args:

  • name: name of the function
  • docstring?: a docstring for the function
  • keyword-name?: the actual name of the tag, defaults to the keyword version of name
Helper in making functions that construct tags.

Args:
- `name`: name of the function
- `docstring?`: a docstring for the function
- `keyword-name?`: the actual name of the tag, defaults to the keyword version of `name`
raw docstring

def-xml-tagsclj/smacro

(def-xml-tags & tags)

defmacro-sclj/smacro

(defmacro-s & args)

Same as defmacro except that it returns and empty string.

Same as `defmacro` except that it returns and empty string.
raw docstring

defn-sclj/smacro

(defn-s & args)

Same as defn except that it returns and empty string.

Same as `defn` except that it returns and empty string.
raw docstring

eval-docclj/s

(eval-doc & args)

Eval a document using the function given by get-eval-doc.

Eval a document using the function given by [[get-eval-doc]].
raw docstring

get-envclj/s

(get-env)
(get-env k)

Get the evaluation environment or the value for one of its keys.

Get the evaluation environment or the value for one of its keys.
raw docstring

get-eval-docclj/s

(get-eval-doc)

Get the eval-forms function from the evaluation environment.

Get the eval-forms function from the evaluation environment.
raw docstring

get-inputclj/s

(get-input)

Get the input value from the evaluation environment.

Get the input value from the evaluation environment.
raw docstring

get-read-docclj/s

(get-read-doc)

Get the reading function from the evaluation environment.

Get the reading function from the evaluation environment.
raw docstring

get-slurp-docclj/s

(get-slurp-doc)

Get the slurping function from the evaluation environment.

Get the slurping function from the evaluation environment.
raw docstring

insert-docclj/smacro

(insert-doc path)

Insert the slurped and read content of another document.

Insert the slurped and read content of another document.
raw docstring

make-mixed-inclj/s

(make-mixed-in cstr classes)

Make a tag constructor that injects some css classes.

Args:

  • cstr: a tag constructor (defined with def-xml-tag for instance)
  • classes: a sequence of css classes names, can be string or keywords

ex: (def container (make-mixed-in div [:container])) (container "some text")

:=> {:tag :div :attrs {:classes "container"} :content "some text"}

Make a tag constructor that injects some css classes.

Args:
- `cstr`: a tag constructor (defined with [[def-xml-tag]] for instance)
- `classes`: a sequence of css classes names, can be string or keywords

ex:
(def container (make-mixed-in div [:container]))
(container "some text")

:=> {:tag :div :attrs {:classes "container"} :content "some text"}
raw docstring

read-docclj/s

(read-doc & args)

Read a string using the function given by get-read-doc.

Read a string using the function given by [[get-read-doc]].
raw docstring

require-docclj/s

(require-doc path)

Insert the slurped, read and evaluated content of another document.

Insert the slurped, read and evaluated content of another document.
raw docstring

set->attrclj/s

(set->attr s)

Turn a set of strings/keywords into a string to be used as the value of an html tag attribute (like the class attribute).

Turn a set of strings/keywords into a string to be used as the value of an html tag attribute
(like the class attribute).
raw docstring

slurp-docclj/s

(slurp-doc & args)

Slurp a document using the function given by get-slurp-doc.

Slurp a document using the function given by [[get-slurp-doc]].
raw docstring

special?clj/s

(special? x)

Determine if x is a special tag.

Determine if `x` is a special tag.
raw docstring

tag-typeclj/s

(tag-type x)

Returns the type of a tag x or nil isn't a map or doesn't have a type.

Returns the type of a tag `x` or nil isn't a map or doesn't have a type.
raw docstring

tag?clj/s

(tag? x)

Determine if x is a normal tag.

Determine if `x` is a normal tag.
raw docstring

xml-tagclj/s≠

clj
(xml-tag name attrs? & content)
cljs
(xml-tag & args)

Constructor of normal tags.

args:

  • name: a keyword giving the tag his name (:div, :my-tag, etc...)
  • attrs: a map of attributes
  • content: the content of the tag, strings, other (special)tags or sequences of both.

Returns a map similar to:

{:type :tag
 :tag name
 :attrs attrs?
 :content content}
Constructor of normal tags.

args:
- `name`: a keyword giving the tag his name (:div, :my-tag, etc...)
- `attrs`: a map of attributes
- `content`: the content of the tag, strings, other (special)tags or sequences of both.

Returns a map similar to:
```clojure
{:type :tag
 :tag name
 :attrs attrs?
 :content content}
```
raw docstring

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

× close