diff --git a/doc/03-Templates.md b/doc/03-Templates.md index b13296c..d8e7fb2 100644 --- a/doc/03-Templates.md +++ b/doc/03-Templates.md @@ -18,5 +18,20 @@ In the latter, you might want to blacklist some tags and only process text in certain places, this can easily be accomplished with: ```clojure - +(defn process-template [mdast template-vals] + (clojure.walk/prewalk + (fn [item] + (if (cybermonday.utils/hiccup? item) + (let [[tag attrs & body] item] + (if (not= tag :code) + (cybermonday.utils/make-hiccup-node + tag + attrs + (map #(if (string? %) + (pogonos.core/render-string % template-vals) + %) + body)) + item)) + item)) + mdast)) ```