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.(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.
Rules in precedence order. The last rule matches unconditionally.
Rules in precedence order. The last rule matches unconditionally.
(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.
(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.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |