(generate-toc html-dom {:keys [list-type toc-class]})
Reads an HTML string and parses it for headers, then returns a list of links to them.
A map of :list-type and :toc-class should be provided. :list-type can be one of :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. :toc-class will be added to the top-level element (ie. ul.toc-class or ol.toc-class)
Reads an HTML string and parses it for headers, then returns a list of links to them. A map of :list-type and :toc-class should be provided. :list-type can be one of :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. :toc-class will be added to the top-level element (ie. ul.toc-class or ol.toc-class)
(generate-toc* elements list-type toc-class)
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