site.fabricate.prototype.html
Namespace
Namespace for creating HTML forms using Hiccup data structures and for verifying their structural correctness using malli schemas. The schemas in this namespace implement a non-interactive subset of the MDN HTML spec.
Functions
element-flat-explainer
- Description
- Explain why the given value does not match the schema for flat HTML content.
- Arguments
ns-kw
- Description
- Convert the given keyword to a namespaced version, using the current ns if not provided.
- Arguments
[ns kw]
[kw]
atomic-element?
- Description
- Returns true if the given value is an atomic HTML/Hiccup element
- Arguments
flow?
- Description
- Returns true if the element is HTML flow content.
- Arguments
explain-element
- Description
- Explain why the given value is not a HTML element.
- Arguments
palpable?
- Description
- Returns true if the node is visible.
- Arguments
[c]
element?
- Description
- Returns true if the given value is a HTML element.
- Arguments
parse-element-flat
- Description
- Parse the given value according to the schema for flat HTML content.
- Arguments
parse-element
- Description
- Parse the given value as a HTML element.
- Arguments
validate-element
- Description
- Attempt to validate the element based on its tag, or the keyword in the first position of the vector.
- Arguments
[elem]
heading?
- Description
- Returns true if the element is HTML heading content.
- Arguments
permitted-contents
- Description
- Gets the permitted contents of the given tag
- Arguments
[tag]
phrasing?
- Description
- Returns true if the element is HTML phrasing content.
- Arguments
Constants
atomic-element
- Description
- Malli schema representing atomic HTML/Hiccup elements
- Type
:malli.core/schema
external-link-pattern
- Description
- Regex pattern for external URLs.
- Type
java.util.regex.Pattern
element-explainers
- Description
- Map with tags (keys) and functions (values) that explain why a value does not match the schema for the HTML element of the given type.
- Type
clojure.lang.PersistentHashMap
element-validators
- Description
- Map with tags (keys) and predicates (values) that check if a value is a HTML element of the given type.
- Type
clojure.lang.PersistentHashMap
html
- Description
- Malli schema for a subset of HTML. Will fail to validate on elements that do not respect the hierarchy of flow and phrasing content.
- Type
:malli.core/schema
inline-tags
- Description
- MDN list of inline HTML element tags
- Type
clojure.lang.PersistentHashSet
element
- Description
- Malli schema for HTML elements.
- Type
:malli.core/schema
flow-tags
- Description
- MDN list of flow content element tags
- Type
clojure.lang.PersistentHashSet
element-flat
- Description
- Simplified schema for HTML elements that does not distinguish between flow, phrasing, heading, or metadata content.
- Type
:malli.core/schema
element-parsers
- Description
- Map with tags (keys) and functions (values) that parse a HTML element of the specific type.
- Type
clojure.lang.PersistentHashMap
metadata-tags
- Description
- MDN list of metadata content element tags
- Type
clojure.lang.PersistentHashSet
phrasing-tags
- Description
- MDN list of phrasing content element tags
- Type
clojure.lang.PersistentHashSet
heading-tags
- Description
- MDN list of heading content element tags
- Type
clojure.lang.PersistentHashSet
embedded-tags
- Description
- MDN list of embedded content element tags
- Type
clojure.lang.PersistentHashSet
tag-contents
- Description
- Map with permitted contents across all tags.
- Type
clojure.lang.PersistentHashMap
phrasing-subtags
- Description
- MDN list of tags that are phrasing content when they contain only phrasing content.
- Type
clojure.lang.PersistentHashSet
transparent-tags
- Description
- MDN list of transparent content tags
- Type
clojure.lang.PersistentHashSet
global-attributes
- Description
- MDN list of global HTML attributes as malli schema
- Type
:malli.core/schema
block-level-tags
- Description
- MDN list of block-level HTML element tags
- Type
clojure.lang.PersistentHashSet
sectioning-tags
- Description
- MDN list of sectioning content element tags
- Type
clojure.lang.PersistentHashSet
internal-link-pattern
- Description
- Regex pattern for internal URLs.
- Type
java.util.regex.Pattern
url
- Description
- Malli schema for URLs.
- Type
clojure.lang.PersistentVector
interactive-tags
- Description
- MDN list of interactive content element tags
- Type
clojure.lang.PersistentHashSet