site.fabricate.prototype.page
Namespace
Functions for transforming processed page contents.
Functions
str->hiccup
- Description
- Converts the given Clojure string into a hiccup element
- Arguments
[expr-str]
blockquote
- Description
- Arguments
[{:keys [caption url author source], :or {caption nil, author "", url ""}, :as opts} & contents]
expr->hiccup
- Description
- Converts the given expression into a hiccup element tokenzed into spans by the value type.
- Arguments
[expr]
aside
- Description
- Arguments
[& contents]
conj-non-nil
- Description
- Arguments
[s & args]
detect-paragraphs
- Description
- For each string in the element split it by the given regex, and insert the result into the original element. Leaves sub-elements as is and inserts them into the preceding paragraph.
- Arguments
[seq re]
[re]
[]
->meta
- Description
- Arguments
[[k v]]
metadata-map->head-elements
- Description
- Return the contents of the metadata map as a sequence of Hiccup elements
- Arguments
[{:keys [page-style scripts title], :as metadata}]
para?
- Description
- Arguments
[i]
not-in-form?
- Description
- Arguments
[e]
ul
- Description
- Arguments
[& contents]
doc-header
- Description
- Returns a default header from a map with a post's metadata.
- Arguments
[{:keys [title page-style scripts], :as metadata}]
in-para?
- Description
- Arguments
[i]
script
- Description
- Arguments
[attr-map & contents]
strong
- Description
- Arguments
[& contents]
em
- Description
- Arguments
[& contents]
fn->spec-form
- Description
- Converts the given function symbol into the conformed spec for function definition
- Arguments
[fn-sym]
opengraph-enhance
- Description
- Enriches the metadata items given by mapping from metadata names to opengraph properties. See https://stackoverflow.com/a/22984013 for more context on combining these attributes in a single HTML element.
- Arguments
[prop-names items]
nil-or-empty?
- Description
- Arguments
[v]
parse-paragraphs
- Description
- Detects the paragraphs within the form
- Arguments
[form {:keys [paragraph-pattern default-form current-paragraph?], :or {paragraph-pattern #, default-form [:p], current-paragraph? false}, :as opts}]
[form]
quote
- Description
- Arguments
[{:keys [cite], :or {cite ""}, :as opts} & contents]
ol
- Description
- Arguments
[& contents]
link
- Description
- Arguments
[url {:keys [frag], :or {frag nil}, :as opts} & contents]
split-paragraphs
- Description
- Arguments
[s re]
code
- Description
- Arguments
[& contents]
simple-expr
- Description
- Takes a Clojure form and yields a string with the Fabricate template expression for that form.
- Arguments
[form {:keys [ctrl-char format-fn], :or {format-fn str, ctrl-char ""}}]
in-code
- Description
- Arguments
[& contents]
lift-metadata
- Description
- Lifts the metadata out of the page contents and into the given metadata map.
- Arguments
[page-contents metadata]
Constants
opengraph-property-map
- Description
- Type
clojure.lang.PersistentArrayMap
ogp-properties
- Description
- Type
clojure.lang.PersistentArrayMap
node->hiccup
- Description
- Type
clojure.lang.MultiFn
default-metadata
- Description
- Type
clojure.lang.PersistentList
default-metadata-map
- Description
- Type
clojure.lang.PersistentArrayMap