~subsetpark/bagatto

ref: 8b5548eb9860800c53b519f84038c9f798d6a498 bagatto/repl.janet -rw-r--r-- 1.2 KiB
8b5548eb — Zach Smith Format 8 months ago
                                                                                
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
(defn eval-data
  ```
  Evaluate an object according to the Bagatto *site data specification*.

  Not necessary to define a module, but can be useful to debug your
  configuration from within the REPL.
  ```
  [data]
  (core/load-data data @{}))

(defn eval-loader
  ```
  Evaluate a loader fiber to view the list of filenames, or filename
  and contents, it produces.

  Not necessary to define a module, but can be useful to debug your
  configuration from within the REPL.
  ```
  [fiber]
  (seq [res :generate fiber] res))

(defn eval-site
  ```
  Evaluate an object according to the Bagatto *site generation specification*,
  given a site data object as context.

  Not necessary to define a module, but can be useful to debug your
  configuration from within the REPL.
  ```
  [site data]
  (core/produce-writer-specs site data @{}))

(defn write-site
  ```
  Given the output of a site generation specification, trigger the
  actual file generation.

  Not necessary to define a module, but can be useful to debug your
  configuration from within the REPL.
  ```
  [writer-specs output-dir]
  (-> writer-specs
      (threads/demand-pipeline writers/writer-init
                               (writers/handle-writes output-dir))))