Liking cljdoc? Tell your friends :D

hive-ingest-kit.parser-rules

Ordered rule chain selecting a parse profile for a fetched response.

A profile is data: {:profile/id :profile/format :profile/content-kind :profile/parser}. Adding a response shape means appending a rule, not editing the folder. The port is hive-spi.ingest.ports/IParserRule; rules a provider registered through hive-spi.ingest.registry run before the built-in chain.

Ordered rule chain selecting a parse profile for a fetched response.

A profile is data: {:profile/id :profile/format :profile/content-kind
:profile/parser}. Adding a response shape means appending a rule, not
editing the folder. The port is hive-spi.ingest.ports/IParserRule; rules a
provider registered through hive-spi.ingest.registry run before the
built-in chain.
raw docstring

article-document?clj

(article-document? {:keys [body]})

True when the response advertises itself as a long-form article: an OpenGraph og:type of article, or an <article> element. Both live in the first pages of markup, so the scan is bounded rather than reading the whole body.

True when the response advertises itself as a long-form article: an OpenGraph
og:type of `article`, or an <article> element. Both live in the first pages of
markup, so the scan is bounded rather than reading the whole body.
sourceraw docstring

default-rulesclj

Rules in precedence order. The last rule matches unconditionally.

Rules in precedence order. The last rule matches unconditionally.
sourceraw docstring

plain-text?clj

(plain-text? {:keys [url content-type]})

True when the response is text/plain, or, absent a Content-Type, the URL carries a plaintext suffix.

True when the response is text/plain, or, absent a Content-Type, the URL
carries a plaintext suffix.
sourceraw docstring

rfc-document?clj

(rfc-document? {:keys [url body]})

True when the response body or URL identifies an IETF RFC.

True when the response body or URL identifies an IETF RFC.
sourceraw docstring

select-profileclj

(select-profile ctx)
(select-profile ctx rules)

Return the profile of the first rule claiming ctx.

Rules a provider registered are consulted BEFORE the built-in chain, so a corpus can claim a response shape the chain would otherwise hand to a generic parser. Falls back to the HTML profile when no rule matches.

Return the profile of the first rule claiming ctx.

Rules a provider registered are consulted BEFORE the built-in chain, so a
corpus can claim a response shape the chain would otherwise hand to a
generic parser. Falls back to the HTML profile when no rule matches.
sourceraw docstring

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