Api providing several tools to use inside or outside of prose document.
Api providing several tools to use inside or outside of prose document.
(<> & 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.
(add-classes t classes)
(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).
(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.
(def-s & args)
Same as def
except that it returns and empty string.
Same as `def` except that it returns and empty string.
(def-xml-tag name docstring? keyword-name?)
(def-xml-tag & args)
Helper in making functions that construct tags.
Args:
name
: name of the functiondocstring?
: a docstring for the functionkeyword-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`
(def-xml-tags & tags)
(defmacro-s & args)
Same as defmacro
except that it returns and empty string.
Same as `defmacro` except that it returns and empty string.
(defn-s & args)
Same as defn
except that it returns and empty string.
Same as `defn` except that it returns and empty string.
(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]].
(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.
(get-eval-doc)
Get the eval-forms function from the evaluation environment.
Get the eval-forms function from the evaluation environment.
(get-input)
Get the input value from the evaluation environment.
Get the input value from the evaluation environment.
(get-read-doc)
Get the reading function from the evaluation environment.
Get the reading function from the evaluation environment.
(get-slurp-doc)
Get the slurping function from the evaluation environment.
Get the slurping function from the evaluation environment.
(insert-doc path)
Insert the slurped and read content of another document.
Insert the slurped and read content of another document.
(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 keywordsex: (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"}
(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]].
(require-doc path)
Insert the slurped, read and evaluated content of another document.
Insert the slurped, read and evaluated content of another document.
(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).
(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]].
(special? x)
Determine if x
is a special tag.
Determine if `x` is a special tag.
(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.
(xml-tag name attrs? & content)
(xml-tag & args)
Constructor of normal tags.
args:
name
: a keyword giving the tag his name (:div, :my-tag, etc...)attrs
: a map of attributescontent
: 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} ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close