(generate-toc html & {:keys [list-type] :or {list-type :ol}})
Reads an HTML string and parses it for headers, then returns a list of links to them.
Optionally, a map of :list-type can be provided with value :ul, :ol, or true. :ol and true will result in an ordered list being generated for the table of contents, while :ul will result in an unordered list. The default is an ordered list.
Reads an HTML string and parses it for headers, then returns a list of links to them. Optionally, a map of :list-type can be provided with value :ul, :ol, or true. :ol and true will result in an ordered list being generated for the table of contents, while :ul will result in an unordered list. The default is an ordered list.
(generate-toc* elements list-type)
The inner part of generate-toc. Takes maps of enlive-style html elements and returns hiccup.
The inner part of generate-toc. Takes maps of enlive-style html elements and returns hiccup.
(get-headings content)
Get all the headings in a sequence of enlive elements.
Get all the headings in a sequence of enlive elements.
(toc-entry anchor text)
Given an anchor link and some text, construct a toc entry consisting of link to the anchor using the given text, wrapped in an <li> tag.
Given an anchor link and some text, construct a toc entry consisting of link to the anchor using the given text, wrapped in an <li> tag.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close