File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 25
25
- name : Install AsciiDoctor
26
26
uses : awalsh128/cache-apt-pkgs-action@latest
27
27
with :
28
- packages : asciidoctor
28
+ packages : asciidoctor pandoc
29
29
version : 1.0
30
30
- name : Build AsciiDoc
31
31
id : adocbuild
Original file line number Diff line number Diff line change 1
1
(ns build
2
- (:require [clojure.java.io :as io]
2
+ (:require [clojure.java.shell :as sh]
3
+ [clojure.java.io :as io]
3
4
[clojure.string :as str]
4
5
[integrant.core :as ig]))
5
6
6
7
(defn- ->asciidoc [s]
7
- (-> s
8
- (str/replace #"(?m)^ " " " )
9
- (str/replace #"(\n [^-][^\n ]*)\n -" " $1\n\n -" )))
8
+ (:out (sh/sh " pandoc" " -t" " asciidoc" :in s)))
9
+
10
+ (defn- space-out-lists [s]
11
+ (str/replace s #"(\n [^-][^\n ]*)\n -" " $1\n\n -" ))
12
+
13
+ (defn- trim-indent [s]
14
+ (str/replace s #"(?m)^ " " " ))
10
15
11
16
(def keywords
12
17
[:duct.database/sql
21
26
(ig/load-annotations )
22
27
23
28
(with-open [writer (io/writer " keywords.adoc" )]
24
- (binding [*out* writer]
25
- (doseq [kw (sort keywords)]
26
- (println (str " === " kw))
27
- (newline )
28
- (println (->asciidoc (:doc (ig/describe kw))))
29
- (newline ))))
29
+ (doseq [kw (sort keywords)]
30
+ (let [doc (-> kw ig/describe :doc trim-indent space-out-lists ->asciidoc)]
31
+ (binding [*out* writer]
32
+ (println " ###" kw)
33
+ (newline )
34
+ (println doc)))))
35
+
36
+ (shutdown-agents )
You can’t perform that action at this time.
0 commit comments