Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 78 additions & 54 deletions API.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Table of contents
- [`hickory.core`](#hickory.core)
- [`Attribute`](#hickory.core/Attribute)
- [`Comment`](#hickory.core/Comment)
- [`Document`](#hickory.core/Document)
- [`DocumentType`](#hickory.core/DocumentType)
- [`Element`](#hickory.core/Element)
- [`HiccupRepresentable`](#hickory.core/HiccupRepresentable) - Objects that can be represented as Hiccup nodes implement this protocol in order to make the conversion.
- [`HickoryRepresentable`](#hickory.core/HickoryRepresentable) - Objects that can be represented as HTML DOM node maps, similar to clojure.xml, implement this protocol to make the conversion.
- [`Text`](#hickory.core/Text)
- [`Attribute`](#hickory.core/attribute)
- [`Comment`](#hickory.core/comment)
- [`Document`](#hickory.core/document)
- [`DocumentType`](#hickory.core/documenttype)
- [`Element`](#hickory.core/element)
- [`HiccupRepresentable`](#hickory.core/hiccuprepresentable) - Objects that can be represented as Hiccup nodes implement this protocol in order to make the conversion.
- [`HickoryRepresentable`](#hickory.core/hickoryrepresentable) - Objects that can be represented as HTML DOM node maps, similar to clojure.xml, implement this protocol to make the conversion.
- [`Text`](#hickory.core/text)
- [`as-hiccup`](#hickory.core/as-hiccup) - Converts the node given into a hiccup-format data structure.
- [`as-hickory`](#hickory.core/as-hickory) - Converts the node given into a hickory-format data structure.
- [`extract-doctype`](#hickory.core/extract-doctype)
Expand All @@ -27,29 +27,49 @@



## <a name="hickory.core/Attribute">`Attribute`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L40-L40)
<a name="hickory.core/Attribute"></a>
## <a name="hickory.core/attribute">`Attribute`</a>

## <a name="hickory.core/Comment">`Comment`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L41-L41)
<a name="hickory.core/Comment"></a>

## <a name="hickory.core/Document">`Document`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L42-L42)
<a name="hickory.core/Document"></a>

## <a name="hickory.core/DocumentType">`DocumentType`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L43-L43)
<a name="hickory.core/DocumentType"></a>
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L52-L52">Source</a></sub></p>

## <a name="hickory.core/comment">`Comment`</a>



<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L53-L53">Source</a></sub></p>

## <a name="hickory.core/document">`Document`</a>



<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L54-L54">Source</a></sub></p>

## <a name="hickory.core/documenttype">`DocumentType`</a>



<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L55-L55">Source</a></sub></p>

## <a name="hickory.core/element">`Element`</a>



<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L56-L56">Source</a></sub></p>

## <a name="hickory.core/hiccuprepresentable">`HiccupRepresentable`</a>


## <a name="hickory.core/Element">`Element`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L44-L44)
<a name="hickory.core/Element"></a>

## <a name="hickory.core/HiccupRepresentable">`HiccupRepresentable`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L11-L17)
<a name="hickory.core/HiccupRepresentable"></a>

Objects that can be represented as Hiccup nodes implement this protocol in
order to make the conversion.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L12-L18">Source</a></sub></p>

## <a name="hickory.core/hickoryrepresentable">`HickoryRepresentable`</a>



## <a name="hickory.core/HickoryRepresentable">`HickoryRepresentable`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L19-L34)
<a name="hickory.core/HickoryRepresentable"></a>

Objects that can be represented as HTML DOM node maps, similar to
clojure.xml, implement this protocol to make the conversion.
Expand All @@ -62,65 +82,68 @@ Objects that can be represented as HTML DOM node maps, similar to
:attrs - node's attributes as a map, check :type to see if applicable
:content - node's child nodes, in a vector, check :type to see if
applicable
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L20-L35">Source</a></sub></p>

## <a name="hickory.core/text">`Text`</a>

## <a name="hickory.core/Text">`Text`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L45-L45)
<a name="hickory.core/Text"></a>

## <a name="hickory.core/as-hiccup">`as-hiccup`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L14-L17)
<a name="hickory.core/as-hiccup"></a>

<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L57-L57">Source</a></sub></p>

## <a name="hickory.core/as-hiccup">`as-hiccup`</a>
``` clojure

(as-hiccup this)
```

Function.

Converts the node given into a hiccup-format data structure. The
node must have an implementation of the HiccupRepresentable
protocol; nodes created by parse or parse-fragment already do.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L15-L18">Source</a></sub></p>

## <a name="hickory.core/as-hickory">`as-hickory`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L31-L34)
<a name="hickory.core/as-hickory"></a>
## <a name="hickory.core/as-hickory">`as-hickory`</a>
``` clojure

(as-hickory this)
```

Function.

Converts the node given into a hickory-format data structure. The
node must have an implementation of the HickoryRepresentable protocol;
nodes created by parse or parse-fragment already do.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L32-L35">Source</a></sub></p>

## <a name="hickory.core/extract-doctype">`extract-doctype`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L109-L114)
<a name="hickory.core/extract-doctype"></a>
## <a name="hickory.core/extract-doctype">`extract-doctype`</a>
``` clojure

(extract-doctype s)
```
Function.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L121-L126">Source</a></sub></p>


## <a name="hickory.core/format-doctype">`format-doctype`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L50-L57)
<a name="hickory.core/format-doctype"></a>
## <a name="hickory.core/format-doctype">`format-doctype`</a>
``` clojure

(format-doctype dt)
```
Function.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L62-L69">Source</a></sub></p>


## <a name="hickory.core/node-type">`node-type`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L36-L38)
<a name="hickory.core/node-type"></a>
## <a name="hickory.core/node-type">`node-type`</a>
``` clojure

(node-type type)
```
Function.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L37-L50">Source</a></sub></p>


## <a name="hickory.core/parse">`parse`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L139-L156)
<a name="hickory.core/parse"></a>
## <a name="hickory.core/parse">`parse`</a>
``` clojure

(parse s)
```

Function.

Parse an entire HTML document into a DOM structure that can be
used as input to as-hiccup or as-hickory.
Expand All @@ -137,41 +160,42 @@ Parse an entire HTML document into a DOM structure that can be



<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L151-L168">Source</a></sub></p>

## <a name="hickory.core/parse-dom-with-domparser">`parse-dom-with-domparser`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L120-L123)
<a name="hickory.core/parse-dom-with-domparser"></a>
## <a name="hickory.core/parse-dom-with-domparser">`parse-dom-with-domparser`</a>
``` clojure

(parse-dom-with-domparser s)
```
Function.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L132-L135">Source</a></sub></p>


## <a name="hickory.core/parse-dom-with-write">`parse-dom-with-write`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L125-L137)
<a name="hickory.core/parse-dom-with-write"></a>
## <a name="hickory.core/parse-dom-with-write">`parse-dom-with-write`</a>
``` clojure

(parse-dom-with-write s)
```

Function.

Parse an HTML document (or fragment) as a DOM using document.implementation.createHTMLDocument and document.write.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L137-L149">Source</a></sub></p>

## <a name="hickory.core/parse-fragment">`parse-fragment`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L158-L163)
<a name="hickory.core/parse-fragment"></a>
## <a name="hickory.core/parse-fragment">`parse-fragment`</a>
``` clojure

(parse-fragment s)
```

Function.

Parse an HTML fragment (some group of tags that might be at home somewhere
in the tag hierarchy under <body>) into a list of DOM elements that can
each be passed as input to as-hiccup or as-hickory.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L170-L175">Source</a></sub></p>

## <a name="hickory.core/remove-el">`remove-el`</a> [:page_facing_up:](https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L116-L118)
<a name="hickory.core/remove-el"></a>
## <a name="hickory.core/remove-el">`remove-el`</a>
``` clojure

(remove-el el)
```

Function.
<p><sub><a href="https://github.com/clj-commons/hickory/blob/master/src/cljs/hickory/core.cljs#L128-L130">Source</a></sub></p>
2 changes: 1 addition & 1 deletion bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
repl:cljs-node (shell "rlwrap bb clojure -M:test:cljs -m cljs.main -re node")
repl:cljs-browser (shell "rlwrap bb clojure -M:test:cljs -m cljs.main")

quickdoc {:extra-deps {io.github.borkdude/quickdoc {:git/sha "62dd3c6a828c3a5e61bae6ca80c8ba4781356a67"}}
quickdoc {:extra-deps {io.github.borkdude/quickdoc {:git/tag "v0.2.5", :git/sha "25784ca"}}
:requires ([quickdoc.api :as api])
:task (api/quickdoc {:source-paths ["src/clj" "src/cljs" "src/cljs"]
:git/branch "master"
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{:paths ["src/clj" "src/cljc" "src/cljs"]
:deps
{org.clojure/clojure {:mvn/version "1.11.1"}
org.jsoup/jsoup {:mvn/version "1.19.1"}}
org.jsoup/jsoup {:mvn/version "1.20.1"}}
:aliases
{:test {:extra-paths ["test/cljc"]}
:cljs {:extra-deps {org.clojure/clojurescript {:mvn/version "1.11.60"}}}
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

:dependencies [[org.clojure/clojure "1.11.1"]
[org.clojure/clojurescript "1.11.60" :scope "provided"]
[org.jsoup/jsoup "1.19.1"]]
[org.jsoup/jsoup "1.20.1"]]

:source-paths ["src/clj" "src/cljc" "src/cljs"]

Expand Down