-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.clj
33 lines (28 loc) · 1.14 KB
/
doc.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
(ns doc
(:require
[babashka.fs :as fs]
[clojure.string :as str]
[dinodoc.api :as dinodoc]))
(def doc-tree [["Polylith" {:file "readme.md"}]])
(dinodoc/generate
{:output-path "docs"
:inputs (concat
[{:path "polylith"
:output-path "."
:doc-tree doc-tree}]
(->> (fs/list-dir "polylith/components")
(map (fn [path]
{:path path
;; Example of specifying :source-paths to only include interface.clj files for API docs
:source-paths (->> (fs/glob path "**/interface.clj")
(map #(fs/relativize path %)))
:output-path (str "Components/" (fs/file-name path))}))))
:github/repo "https://github.com/polyfy/polylith"
:git/branch "master"})
(fs/copy-tree "polylith/images" "docs/images")
(fs/update-file "docs/index.md"
(fn [input]
(-> input
(str/replace #"(<img[^>]+\")>" "$1/>")
(str/replace #"src=\"(images/[^\"]+)\"" "src={require(\"./$1\").default}"))))
(shutdown-agents)