Browse Source

Inlining link separator code

Stephen Starkey 2 weeks ago
parent
commit
c8c4e984d4
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      src/calmabiding/core.clj

+ 5
- 4
src/calmabiding/core.clj View File

@@ -7,14 +7,15 @@
7 7
             [clojure.java.io :as io]
8 8
             [clojure.string :as str]))
9 9
 
10
-(defn link-separator []
11
-  (str/join "" [" " "·" " "]))
12
-
13 10
 (defn link-group
14 11
   "Take the container (a collection), append the links, interleaved with link-separators,
15 12
   to the end, and convert the result to a vector"
16 13
   [container & links]
17
-  (vec (concat container (drop-last (interleave links (repeat (link-separator)))))))
14
+  (let [separator (str/join "" [" " "·" " "])
15
+        separators (repeat separator)]
16
+    (->> (-> links (interleave separators) drop-last)
17
+         (concat container)
18
+         vec)))
18 19
 
19 20
 (defn wrap-contents [stylesheet contents]
20 21
   (str "<!DOCTYPE html>"