From b3bad2e279292ab5fd875ddf1c148cc008d39f36 Mon Sep 17 00:00:00 2001 From: Adam Tankanow Date: Fri, 9 Jan 2015 07:13:35 -0500 Subject: [PATCH] add docstring to get-headings function --- src/cryogen_core/toc.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cryogen_core/toc.clj b/src/cryogen_core/toc.clj index e44c212..a1021d5 100644 --- a/src/cryogen_core/toc.clj +++ b/src/cryogen_core/toc.clj @@ -5,7 +5,10 @@ (def _h [:h1 :h2 :h3 :h4 :h5 :h6]) (defn- compare_index [i1 i2] (- (.indexOf _h i2) (.indexOf _h i1))) -(defn get-headings [content] +(defn- get-headings + "Turn a body of html content into a vector of elements whose tags are + headings." + [content] (reduce (fn [headings {:keys [tag attrs content] :as elm}] (if (some #{tag} _h)