diff --git a/src/smeagol/extensions/photoswipe.clj b/src/smeagol/extensions/photoswipe.clj index 2df235e..ee80792 100644 --- a/src/smeagol/extensions/photoswipe.clj +++ b/src/smeagol/extensions/photoswipe.clj @@ -175,8 +175,6 @@ (defn process-photoswipe [^String url-or-pswp-spec ^Integer index] - (log/info "process-photoswipe called with arg1 `" - url-or-pswp-spec "`; arg2 `" index "`.") (let [data (resource-url-or-data->data url-or-pswp-spec) spec (cs/trim (:data data)) result @@ -184,5 +182,6 @@ (cs/starts-with? spec "![") (process-simple-photoswipe spec index) (process-full-photoswipe spec index))] - (log/info "process-photoswipe returning `" result "`.") +;; (log/info "process-photoswipe returning `" result "`.") + result )) diff --git a/src/smeagol/formatting.clj b/src/smeagol/formatting.clj index 115a2ca..3bb0d63 100644 --- a/src/smeagol/formatting.clj +++ b/src/smeagol/formatting.clj @@ -63,32 +63,9 @@ no-text-error)) -(defn yaml->json - "Rewrite this string, assumed to be in YAML format, as JSON." - [^String yaml-src] - (json/write-str (yaml/parse-string yaml-src))) - - (declare process-text) -(defn process-vega - "Process this `vega-src` string, assumed to be in YAML format, into a specification - of a Vega chart, and add the plumbing to render it." - [^String vega-src ^Integer index] - (str - "
\n" - "")) - - (defn process-backticks "Effectively, escape the backticks surrounding this `text`, by protecting them from the `md->html` filter." @@ -117,7 +94,7 @@ (cons fragment processed))) -(defn- apply-formatter +(defn apply-formatter "Within the context of `process-text`, process a fragment for which an explicit §formatter has been identified. @@ -128,11 +105,14 @@ [index result fragments processed fragment token formatter] (let [kw (keyword (str "inclusion-" index))] - (process-text - (inc index) - (assoc-in result [:inclusions kw] (apply formatter (list (subs fragment (count token)) index))) - (rest fragments) - (cons kw processed)))) + (assoc-in + (process-text + (inc index) + result + (rest fragments) + (cons kw processed)) + [:inclusions kw] + (apply formatter (list (subs fragment (count token)) index))))) (defn process-text @@ -182,8 +162,11 @@ fragment first-token formatter)] + ;; TODO: consistency: either these things are `extensions`, or + ;; they're `formatters`. I incline to the view that they're + ;; `:extensions` (assoc-in result [:extensions kw] (-> config :formatters kw))) - true + :else ;; Otherwise process the current fragment as markdown and recurse on ;; down the list (process-markdown-fragment