From a6b0eb8a5e56fe87d6e94efe5aa0e8bf42092e5f Mon Sep 17 00:00:00 2001 From: Carsten Behring Date: Sat, 19 Oct 2024 11:06:53 +0200 Subject: [PATCH 1/4] removed image push --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfec0a6..9bd0a13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,10 +30,7 @@ jobs: - name: Run make ci-build in dev container uses: devcontainers/ci@v0.3 - with: - imageName: ghcr.io/scicloj/noj-devontainer - cacheFrom: ghcr.io/scicloj/noj-devontainer - push: always + push: never runCmd: clj -T:build ci make-doc: From 15f1e76e38204c979a61deb72ab765f217f3dde8 Mon Sep 17 00:00:00 2001 From: Carsten Behring Date: Sat, 19 Oct 2024 11:09:41 +0200 Subject: [PATCH 2/4] Aktualisieren von ci.yml --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bd0a13..d7bf70b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: - name: Run make ci-build in dev container uses: devcontainers/ci@v0.3 + with: push: never runCmd: clj -T:build ci From 2a64c26825ca34b3de901bfb799dac2c4a496d5a Mon Sep 17 00:00:00 2001 From: Carsten Behring Date: Mon, 21 Oct 2024 06:40:27 +0200 Subject: [PATCH 3/4] Aktualisieren von ci.yml --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7bf70b..3afcb2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,9 +51,8 @@ jobs: - name: Make docs in dev container uses: devcontainers/ci@v0.3 with: - imageName: ghcr.io/scicloj/noj-devontainer - cacheFrom: ghcr.io/scicloj/noj-devontainer - push: always + + push: never runCmd: clj -Adev notebooks/dev.clj - name: fix permisions From 29ed195a39ce6064989e51de7a49a5203a73b8b6 Mon Sep 17 00:00:00 2001 From: Carsten Behring Date: Sat, 23 Nov 2024 22:53:12 +0000 Subject: [PATCH 4/4] added fn to render notebook files --- .github/workflows/ci.yml | 2 +- notebooks/dev.clj | 45 +++++++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3afcb2f..1ff6c3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: with: push: never - runCmd: clj -Adev notebooks/dev.clj + runCmd: clj -A:dev -X dev/render-all-notebooks - name: fix permisions run: sudo chmod o+w docs/ diff --git a/notebooks/dev.clj b/notebooks/dev.clj index 43c6976..11a31bd 100644 --- a/notebooks/dev.clj +++ b/notebooks/dev.clj @@ -1,19 +1,16 @@ (ns dev - (:require [scicloj.clay.v2.api :as clay])) + (:require + [clojure.edn :as edn] + [scicloj.clay.v2.api :as clay])) -(defn base-config [] + + + +(defn base-config [clj-files] {:show false :format [:quarto :html] :base-source-path "notebooks" - :source-path (->> "notebooks/chapters.edn" - slurp - clojure.edn/read-string - (map (fn [part] - (-> part - (update - :chapters - (partial map #(format "noj_book/%s.clj" %)))))) - (cons "index.clj")) + :source-path clj-files :base-target-path "docs" :book {:title "Noj"} :clean-up-target-dir true @@ -23,13 +20,33 @@ "}}}) +(def clj-files + (->> "notebooks/chapters.edn" + slurp + edn/read-string + (map (fn [part] + (-> part + (update + :chapters + (partial map #(format "noj_book/%s.clj" %)))))) + (cons "index.clj")) + + ) + ;; For interactive local testing: (comment - (-> (base-config) + (-> (base-config clj-files) (assoc :show true :base-target-path "docs-draft") clay/make!)) +;; can be called by +;; clj -A:dev -X dev/render-notebook :notebook '"noj_book/ml_basic.clj"' +(defn render-notebook [opts] + (clay/make! (base-config [(:notebook opts)])) + (System/exit 0)) + +(defn render-all-notebooks [_opts] + (clay/make! (base-config clj-files)) + (System/exit 0)) -(clay/make! (base-config)) -(System/exit 0)