-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbb.edn
More file actions
90 lines (84 loc) · 5.25 KB
/
Copy pathbb.edn
File metadata and controls
90 lines (84 loc) · 5.25 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
;; bb.edn — docs-engine, the shared static-site generator for jlt-commons
;; project documentation.
;;
;; Every task takes the path to a project checkout. The engine reads that
;; project's docs/ and writes its _site/, and touches nothing else.
{:paths ["src" "test" "resources"]
:deps {;; :exclusions drops clj-commons/clj-yaml, markdown-clj's own
;; transitive dep for YAML-frontmatter parsing (see docs-engine#3):
;; its namespace-load-time DumperOptions$FlowStyle reference isn't
;; resolvable under jolt. jolt-lang/yaml (below) supplies a
;; clj-yaml.core-compatible namespace that markdown.transformers'
;; own (:require [clj-yaml.core ...]) finds once the real one is
;; excluded, on both hosts -- no per-host branching needed.
;;
;; Safe to exclude on EITHER host, not just untested-so-far: the
;; YAML branch only fires when a doc's first line is a literal
;; "---", and site.markdown's own unwrap-hard-wraps already
;; rewrites every "---"-only line to "***" before markdown-clj
;; ever sees the text (the existing dash-hr-renders-as-phantom-
;; heading fix). So parse-yaml-metadata-headers, and therefore
;; clj-yaml.core/parse-string, is unreachable through this
;; pipeline on any input -- verified by reading markdown-clj
;; 1.11.4's own transformers.cljc, not assumed.
markdown-clj/markdown-clj {:mvn/version "1.11.4"
:exclusions [clj-commons/clj-yaml]}
io.github.jolt-lang/yaml {:git/url "https://github.com/jolt-lang/yaml.git"
:git/sha "972b93c01685a6c02e40bae293ad51c78bcc743f"}
;; babashka bundles selmer as a built-in, so this project never
;; needed to declare it before. jolt doesn't bundle it the same
;; way -- an explicit :mvn/version is what makes `jolt run build`
;; able to resolve selmer.parser at all (see docs-engine#3).
selmer/selmer {:mvn/version "1.12.59"}
;; Selmer's date filters reference java.time.format.FormatStyle at
;; namespace-load time (see docs-engine#3). jolt has no built-in
;; java.time shim, but requiring jolt-lang/time installs one, and
;; that happens below, before any task-specific require, so it's
;; in place before selmer.parser ever loads. Verified harmless
;; under bb too: pure Clojure, no jolt.ffi, tick.core/now works
;; unchanged (bb already has real java.time; this just adds tick's
;; API on top of it).
io.github.jolt-lang/time {:git/url "https://github.com/jolt-lang/time.git"
:git/sha "abeee49974c2c4efa2fa75c96d9a379822c6815f"}}
:tasks
{;; tick.core first, unconditionally -- see the io.github.jolt-lang/time
;; comment above :deps. Everything after it in this list, and every
;; task's own :requires, can then assume java.time is fully available.
:requires ([tick.core]
[site.project :as project])
:init
(def project-dir
(fn []
(or (first *command-line-args*)
(do (println "Usage: bb <task> <path-to-project> [...]")
(println " e.g. bb serve ../raylib-jlt")
(System/exit 1)))))
info {:doc "What this is and how to point it at a project"
:task (do
(println "docs-engine — the jlt-commons documentation site generator\n")
(println " jolt run build <project> generate <project>/_site/")
(println " jolt run clean <project> delete <project>/_site/")
(println " bb test run the test suite")
(println " bb serve <project> [port] build, then serve at localhost:3000\n")
(println "build/clean run under either tool (jolt run <task>, not bare jolt <task>:")
(println "build collides with jolt's own build -m NS subcommand). test/serve stay")
(println "bb-only: jolt doesn't bundle clojure.test or http-kit.\n")
(println "A project configures itself in docs/site.edn. See README.md."))}
test {:doc "Run the full test suite"
:requires ([clojure.test :as t]
[site.markdown-test]
[site.project-test]
[site.core-test]
[site.search-test])
:task (let [{:keys [fail error]} (t/run-tests 'site.markdown-test 'site.project-test 'site.core-test 'site.search-test)]
(when (pos? (+ fail error)) (System/exit 1)))}
build {:doc "Generate a project's site into its _site/ (bb build <project>, or jolt run build <project>)"
:requires ([site.core :as core])
:task (core/generate! (project/resolve-project (project-dir)))}
clean {:doc "Delete a project's _site/ build output (bb clean <project>, or jolt run clean <project>)"
:requires ([site.core :as core])
:task (core/clean! (project/resolve-project (project-dir)))}
serve {:doc "Build, then serve a project locally (bb serve <project> [port], default 3000)"
:requires ([site.serve :as serve])
:task (serve/serve! (project/resolve-project (project-dir))
(second *command-line-args*))}}}