Liking cljdoc? Tell your friends :D

html-to-md.hiccup-to-md

This namespace works on hiccup data structures.

There is a lot of infinite sequences, that can make debugging a bit annoying. Consider using html-to-md.debug/no-infinity to reduce output.

This namespace works on hiccup data structures.

There is a lot of infinite sequences, that can make debugging a bit annoying.
Consider using html-to-md.debug/no-infinity to reduce output.
raw docstring

arrangeclj

(arrange all-elements)

The final function converting the intermediate data structure representing markdown and converting it to strings.

The final function converting the intermediate data structure representing markdown
and converting it to strings.
sourceraw docstring

as-blockclj

(as-block attr elements)
source

as-flowclj

(as-flow s)
source

as-markdownclj

(as-markdown hiccup)
source

(avoid-complex-links url flow-elements)

This hairy function manages complex HTML content wrapped in a link. Instead of trying to wrap a markdown link around all of it, it references the link in the beginning, then insert all the complex content, then mentions that the link is no longer being referenced.

This hairy function manages complex HTML content wrapped in a link.
Instead of trying to wrap a markdown link around all of it,
it references the link in the beginning, then insert all the complex content,
then mentions that the link is no longer being referenced.
sourceraw docstring

block?clj

(block? element)
source

calc-inline-marginsclj

(calc-inline-margins s)

Calculate margins of inline content (CharSequence).

Calculate margins of inline content (`CharSequence`).
sourceraw docstring

calc-marginsclj

(calc-margins spacing inherited-margins first? last?)

Takes element margins and possible inherited margins along with the position of the element.

Takes element margins and possible inherited margins along with the position of the element.
sourceraw docstring

child-elementsclj

(child-elements [_tag attr & elements :as _element])

Since hiccup attr(ibutes) are optional sometimes the position actually contain a child node instead, that needs to be re-attached.

Since hiccup attr(ibutes) are optional sometimes the position actually
contain a child node instead, that needs to be re-attached.
sourceraw docstring

combine-prefix-seqclj

(combine-prefix-seq current-prefix-seq extra-prefix-seq)
source

decode-html-entitiesclj

(decode-html-entities s)

Reverses escaping of HTML entities done during HTML->Hiccup.

Reverses escaping of HTML entities done during HTML->Hiccup.
sourceraw docstring

has-content?clj

(has-content? element)

Whether an element has relevant content for the output.

Relies on correct trimming of elements. Most goes through as-flow but tags like :pre should preserve whitespace.

Whether an element has relevant content for the output.

Relies on correct trimming of elements.
Most goes through `as-flow` but tags like `:pre` should preserve whitespace.
sourceraw docstring

heading-levelsclj

source

identify-tag-handlerclj

(identify-tag-handler ctx element)
source

joinclj

(join element-a element-b)

Takes two flow elements and joins them into one single flow element. Supports nil to represent nothing instead of an inline element.

Does not support weird elements like {:text "some text"} or {:left 1 :right 0 :text nil}

Takes two `flow` elements and joins them into one single `flow` element.
Supports `nil` to represent nothing instead of an `inline` element.

Does not support weird elements like `{:text "some text"}`
or `{:left 1 :right 0 :text nil}`
sourceraw docstring

ordered-list-prefixesclj

source

render-elementscljmultimethod

source

render-textclj

(render-text prefix-seqs text)

Takes prefix-seq (which can be empty) together with a text string, and returns the text with any provided prefix(s). Also, HTML entities encoded by hiccup are cleaned up (reversed).

Takes `prefix-seq` (which can be empty) together with a text string,
and returns the text with any provided prefix(s).
Also, HTML entities encoded by hiccup are cleaned up (reversed).
sourceraw docstring

skip-firstclj

(skip-first colls)

Takes a vector of collections and skips the first element in ALL collections.

Takes a vector of collections and skips the first element in ALL collections.
sourceraw docstring

spliceclj

(splice all-elements)

Simplifies the intermediate Markdown structure by 'joining' all inline content. Empty elements not relevant for spacing are dropped.

Simplifies the intermediate Markdown structure by 'joining' all inline content.
Empty elements not relevant for spacing are dropped.
sourceraw docstring

unfoldclj

(unfold prefix-seqs inherited-margins all-elements)

Flatten the intermediate Markdown structure. The returned value only needs to have vertical spacing applied and prefixed every line.

prefix-seqs MUST be a vector at all times to maintain correct indenting.

Flatten the intermediate Markdown structure.
The returned value only needs to have vertical spacing applied and prefixed every line.

`prefix-seqs` MUST be a vector at all times to maintain correct indenting.
sourceraw docstring

unordered-list-prefixesclj

source

(wrap-complex-link-content url flow-elements)
source

zero-width-spaceclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close