-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.clj
30 lines (25 loc) · 902 Bytes
/
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
(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
: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)