-
Notifications
You must be signed in to change notification settings - Fork 0
/
templates.clj
38 lines (34 loc) · 1.34 KB
/
templates.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
;; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;; @ Copyright (c) Michael Leahcim @
;; @ You can find additional information regarding licensing of this work in LICENSE.md @
;; @ You must not remove this notice, or any other, from this software. @
;; @ All rights reserved. @
;; @@@@@@ At 2018-10-18 23:40 <thereisnodotcollective@gmail.com> @@@@@@@@@@@@@@@@@@@@@@@@
(ns thereisnodot.akronim.templates)
(defn docstring-template-nothing
[docstring examples] docstring)
(defn docstring-template-text
[docstring examples]
(str docstring "\n\n"
(apply
str
(for [[should _ result] (partition 3 examples)]
(str should " => " result "\n")))))
(defn docstring-template-markdown
[docstring examples]
(str docstring "\n\n"
"```clojure\n\n"
(apply
str
(for [[should _ result] (partition 3 examples)]
(str should " => " result "\n")))
"\n```"))
(defn docstring-template-hljs
[docstring examples]
(str docstring "</br>"
"<pre><code class='hljs clojure'>\n"
(apply
str
(for [[should _ result] (partition 3 examples)]
(str should " => " result "\n")))
"</code></pre>"))