Skip to content

Commit 5e44d21

Browse files
committed
Merge branch 'main' into violinplot
2 parents 1b7e767 + 2f6cb7a commit 5e44d21

129 files changed

Lines changed: 40983 additions & 896 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
workflow_dispatch:
6+
inputs:
7+
publish:
8+
description: "Deploy to Pages (manual runs only)"
9+
type: boolean
10+
default: false
11+
12+
name: Incremental Render and Publish
13+
14+
permissions:
15+
contents: read
16+
17+
env:
18+
SITE_CACHE_REPO: ${{ secrets.SITE_CACHE_REPO }}
19+
SITE_CACHE_TOKEN: ${{ secrets.SITE_CACHE_TOKEN }}
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Check out repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # need history to get mtimes
30+
31+
- name: Normalize source repo file mtimes to last commit
32+
run: |
33+
set -euo pipefail
34+
git ls-files -z | xargs -0 -I{} sh -c 'ts=$(git log -1 --format=%ct -- "{}" || true); if [ -n "$ts" ]; then touch -d "@$ts" "{}"; fi'
35+
36+
- name: Restore `site` from cache repo without overwriting source controlled files
37+
run: |
38+
set -euo pipefail
39+
git clone "https://x-access-token:${SITE_CACHE_TOKEN}@github.com/${SITE_CACHE_REPO}.git" /tmp/site-cache
40+
cd /tmp/site-cache
41+
git ls-files -z -- site/ | xargs -0 -I{} sh -c 'ts=$(git log -1 --format=%ct -- "{}" || true); if [ -n "$ts" ]; then touch -d "@$ts" "{}"; fi'
42+
cd -
43+
rsync -a --ignore-existing /tmp/site-cache/site/ site/ || true
44+
echo "Contents of site/ after restore:"
45+
ls -lah site/ | head -50
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.10'
51+
- name: Install dependencies
52+
run: |
53+
pip install plotly kaleido
54+
55+
- name: Set up Java
56+
uses: actions/setup-java@v4
57+
with:
58+
distribution: 'temurin'
59+
java-version: '21'
60+
61+
- name: Set up Clojure
62+
uses: DeLaGuardo/setup-clojure@main
63+
with:
64+
cli: 'latest'
65+
66+
- name: Cache clojure dependencies
67+
uses: actions/cache@v3
68+
with:
69+
path: |
70+
~/.m2/repository
71+
~/.gitlibs
72+
~/.deps.clj
73+
key: cljdeps-${{ runner.os }}
74+
75+
- name: Detect changed Clojure sources
76+
id: changed_clj
77+
run: |
78+
set -euo pipefail
79+
changed=""
80+
if [ -f /tmp/site-cache/SOURCE_COMMIT ]; then
81+
source_commit=$(cat /tmp/site-cache/SOURCE_COMMIT)
82+
echo "Using source commit recorded in cache: $source_commit"
83+
changed=$(git diff --name-only --diff-filter=ACMR "$source_commit" HEAD -- 'src/**/*.clj' | tr '\n' ' ')
84+
fi
85+
if [ -z "$changed" ]; then
86+
echo "No changed Clojure sources detected"
87+
exit 0
88+
fi
89+
echo "Changed Clojure source files:" $changed
90+
echo "files=$changed" >> "$GITHUB_OUTPUT"
91+
92+
- name: Build notebooks
93+
run: clojure -M:clay -A:markdown ${{ steps.changed_clj.outputs.files }}
94+
95+
- name: Set up Quarto
96+
uses: quarto-dev/quarto-actions/setup@v2
97+
with:
98+
tinytex: true
99+
100+
- name: Render Quarto
101+
uses: quarto-dev/quarto-actions/render@v2
102+
with:
103+
path: site
104+
105+
- name: Upload artifact for Pages
106+
uses: actions/upload-pages-artifact@v3
107+
with:
108+
path: site/_site
109+
110+
- name: Push site to cache repo
111+
run: |
112+
set -euo pipefail
113+
source_commit=$(git rev-parse HEAD)
114+
rm -rf /tmp/site-cache/site
115+
cp -r site /tmp/site-cache/
116+
echo "$source_commit" > /tmp/site-cache/SOURCE_COMMIT
117+
cd /tmp/site-cache
118+
git config user.email "github-actions@github.com"
119+
git config user.name "GitHub Actions"
120+
git add -A
121+
if ! git diff --cached --quiet; then
122+
git commit -m "Cache update from build ${source_commit}"
123+
git checkout -b temp
124+
git push --force origin main
125+
else
126+
echo "No changes to cache."
127+
fi
128+
129+
deploy:
130+
needs: build
131+
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' && github.ref == 'refs/heads/main')
132+
permissions:
133+
pages: write
134+
id-token: write
135+
environment:
136+
name: github-pages
137+
url: ${{ steps.deployment.outputs.page_url }}
138+
runs-on: ubuntu-latest
139+
steps:
140+
- name: Deploy to GitHub Pages
141+
id: deployment
142+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/temp
2-
/site/*/
2+
/site
33
.clj-kondo/
44
.quarto/
55
_site/

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ If you `git add -f site/my-ns/my-post.qmd`,
181181
it will prevent the source `src/my-ns/my-post.clj` file from executing in the publish process.
182182
Only you will run the code locally (where you have secrets and large files available).
183183

184+
If your notebook displays locally stored images, you will also need to commit these. Quarto puts them under `site/my-ns/my-post_files`.
185+
184186
See [Some notebooks should only be run locally](https://clojurecivitas.github.io/scicloj/clay/skip_if_unchanged_example.html) for more detail.
185187

186188
### Styling and other features
@@ -306,7 +308,21 @@ Goal: Minimize friction in authoring while ensuring publishable reproducibility.
306308

307309
## Deployment
308310

309-
See [.github/workflows/render-and-publish.yml](.github/workflows/render-and-publish.yml)
311+
The site is built and deployed using GitHub Actions with two workflows:
312+
313+
- **Full Build and Publish**: Triggered on pushes to `main`.
314+
Rebuilds all notebooks with Clay, renders the entire site with Quarto, and deploys to GitHub Pages.
315+
See [.github/workflows/render-and-publish.yml](.github/workflows/render-and-publish.yml).
316+
317+
- **Incremental Build**: Triggered on pushes to `main`.
318+
Uses a separate cache repository to enable partial rebuilds.
319+
Restores the cached site (containing rendered HTML and generated files) without overwriting source-controlled files in `site/`.
320+
Sets file mtimes of source and cache files based on the last commit so that Quarto will know if the cached file is newer than the source.
321+
Compares the current source commit to the last build source commit (stored in the cache) to detect changes in Clojure sources.
322+
Rebuilds affected notebooks with Clay (rebuilds all if no changes detected).
323+
Renders the site incrementally with Quarto.
324+
Replaces the cache with the new site, and writes the source commit in a file in the cache.
325+
See [.github/workflows/render-and-publish-incremental.yml](.github/workflows/render-and-publish-incremental.yml).
310326

311327
## License
312328

deps.edn

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
io.github.clojure/core.async.flow-monitor {:git/tag "v0.1.2"
1111
:git/url "https://github.com/clojure/core.async.flow-monitor"
1212
:git/sha "6248a5d"}
13+
criterium/criterium {:mvn/version "0.4.6"}
1314
metosin/malli {:mvn/version "0.19.1"}
1415
clj-fuzzy/clj-fuzzy {:mvn/version "0.4.1"}
1516
clj-thamil/clj-thamil {:mvn/version "0.2.0"}
16-
org.scicloj/clay {:mvn/version "2.0.2"}
17+
org.scicloj/clay {:mvn/version "2.0.5"}
1718
org.scicloj/kindly {:mvn/version "4-beta21"}
1819
thi.ng/geom {:mvn/version "1.0.1"}
1920
org.eclipse.elk/org.eclipse.elk.core {:mvn/version "0.10.0"}
@@ -25,20 +26,37 @@
2526
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
2627
io.github.alza-bitz/snowpark-clj {:git/url "https://github.com/alza-bitz/snowpark-clj.git"
2728
:git/sha "7856d9ca2080b188f9feec115ca709d3f54877b0"}
28-
org.lwjgl/lwjgl {:mvn/version "3.3.6"}
29-
org.lwjgl/lwjgl$natives-linux {:mvn/version "3.3.6"}
30-
org.lwjgl/lwjgl-opengl {:mvn/version "3.3.6"}
31-
org.lwjgl/lwjgl-opengl$natives-linux {:mvn/version "3.3.6"}
32-
org.lwjgl/lwjgl-opengl$natives-windows {:mvn/version "3.3.6"}
33-
org.lwjgl/lwjgl-opengl$natives-macos {:mvn/version "3.3.6"}
34-
org.lwjgl/lwjgl-glfw {:mvn/version "3.3.6"}
35-
org.lwjgl/lwjgl-glfw$natives-linux {:mvn/version "3.3.6"}
36-
org.lwjgl/lwjgl-glfw$natives-windows {:mvn/version "3.3.6"}
37-
org.lwjgl/lwjgl-glfw$natives-macos {:mvn/version "3.3.6"}
38-
org.lwjgl/lwjgl-stb {:mvn/version "3.3.6"}
39-
org.lwjgl/lwjgl-stb$natives-linux {:mvn/version "3.3.6"}
40-
org.lwjgl/lwjgl-stb$natives-windows {:mvn/version "3.3.6"}
41-
org.lwjgl/lwjgl-stb$natives-macos {:mvn/version "3.3.6"}
29+
org.lwjgl/lwjgl {:mvn/version "3.4.0"}
30+
org.lwjgl/lwjgl$natives-linux {:mvn/version "3.4.0"}
31+
org.lwjgl/lwjgl-opengl {:mvn/version "3.4.0"}
32+
org.lwjgl/lwjgl-opengl$natives-linux {:mvn/version "3.4.0"}
33+
org.lwjgl/lwjgl-opengl$natives-windows {:mvn/version "3.4.0"}
34+
org.lwjgl/lwjgl-opengl$natives-macos {:mvn/version "3.4.0"}
35+
org.lwjgl/lwjgl-glfw {:mvn/version "3.4.0"}
36+
org.lwjgl/lwjgl-glfw$natives-linux {:mvn/version "3.4.0"}
37+
org.lwjgl/lwjgl-glfw$natives-windows {:mvn/version "3.4.0"}
38+
org.lwjgl/lwjgl-glfw$natives-macos {:mvn/version "3.4.0"}
39+
org.lwjgl/lwjgl-stb {:mvn/version "3.4.0"}
40+
org.lwjgl/lwjgl-stb$natives-linux {:mvn/version "3.4.0"}
41+
org.lwjgl/lwjgl-stb$natives-windows {:mvn/version "3.4.0"}
42+
org.lwjgl/lwjgl-stb$natives-macos {:mvn/version "3.4.0"}
43+
comb/comb {:mvn/version "1.0.0"}
44+
midje/midje {:mvn/version "1.10.10"}
45+
dev.data-star.clojure/sdk {:mvn/version "1.0.0-RC4"}
46+
dev.data-star.clojure/http-kit {:mvn/version "1.0.0-RC4"}
47+
dev.data-star.clojure/brotli {:mvn/version "1.0.0-RC4"}
48+
dev.data-star.clojure/malli-schemas {:mvn/version "1.0.0-RC4"}
49+
dev.data-star.clojure/http-kit-malli-schemas {:mvn/version "1.0.0-RC4"}
50+
dev.data-star.clojure/ring-malli-schemas {:mvn/version "1.0.0-RC4"}
51+
52+
;; libraries for GIS work
53+
org.apache.sis.storage/sis-geotiff {:mvn/version "1.5"}
54+
org.apache.sis.core/sis-referencing {:mvn/version "1.5"}
55+
org.geotools/gt-geotiff {:mvn/version "31.2"}
56+
org.geotools/gt-main {:mvn/version "31.2"}
57+
org.geotools/gt-epsg-hsql {:mvn/version "31.2"}
58+
org.geotools/gt-geojson {:mvn/version "31.2"}
59+
4260
clj-http/clj-http {:mvn/version "3.13.1"}
4361

4462
generateme/fastmath {:mvn/version "3.0.0-alpha4"}
@@ -48,14 +66,16 @@
4866

4967
org.soulspace/qclojure {:mvn/version "0.22.0"}
5068
org.babashka/http-client {:mvn/version "0.4.22"}
51-
com.github.danielsz/bioscoop {:mvn/version "1.0.5"}
69+
io.github.babashka/sci.nrepl {:mvn/version "0.0.2"}
70+
com.github.danielsz/bioscoop {:mvn/version "1.0.5"
71+
:exclusions [ch.qos.logback/logback-classic]}
5272
yamlscript/core {:git/url "https://github.com/yaml/yamlscript"
5373
:git/sha "ed7adfbf90a39f379d5a7193bb2e4bdd7f0eecf8"
5474
:deps/root "core"}
55-
5675
com.hyperphor/multitool {:mvn/version "0.2.3"}
76+
datascript/datascript {:mvn/version "1.7.8"}}
5777

58-
}
78+
:mvn/repos {"osgeo" {:url "https://repo.osgeo.org/repository/release/"}}
5979

6080
:aliases
6181
{;; Build the site with `clojure -M:clay -A:markdown`

site/_quarto.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,53 @@ project:
44
- "*.cljs"
55
- "*.svg"
66
- "*.png"
7+
- "*.tif"
78

89
website:
910
title: "Clojure Civitas"
1011
favicon: "favicon.ico"
1112
site-url: "https://clojurecivitas.github.io"
1213
image: "/images/civitas-icon.svg"
13-
draft-mode: unlinked
14+
draft-mode: visible
1415
open-graph: true
1516
navbar:
1617
logo: "/images/civitas-icon.svg"
1718
logo-alt: "Clojure Civitas Logo"
1819
right:
1920
- about.qmd
2021
- posts.qmd
22+
- drafts.qmd
2123
- civitas/authors.qmd
2224
- civitas/explorer.qmd
2325
- icon: github
2426
href: "https://github.com/ClojureCivitas/clojurecivitas.github.io"
2527
- icon: rss
2628
href: posts.xml
29+
sidebar:
30+
- id: emmy-fdg
31+
title: "Functional Differential Geometry in Emmy"
32+
logo: "https://raw.githubusercontent.com/mentat-collective/emmy/main/doc/img/logo.png"
33+
contents:
34+
- href: mentat_collective/emmy/fdg_prologue.qmd
35+
text: "Prologue"
36+
- section: "Chapters"
37+
contents:
38+
- href: mentat_collective/emmy/fdg_ch01.qmd
39+
text: "FDG Chapter 1"
40+
- href: mentat_collective/emmy/sicm_original_ch01.qmd
41+
text: "SICM Chapter 1"
42+
- href: mentat_collective/emmy/fdg_ch02.qmd
43+
text: "FDG Chapter 2"
44+
- href: mentat_collective/emmy/fdg_ch03.qmd
45+
text: "FDG Chapter 3"
46+
- href: mentat_collective/emmy/fdg_ch01_ys.qmd
47+
text: "FDG Ch01 Infix"
48+
- href: mentat_collective/emmy/sicm_ch01.qmd
49+
text: "SICM Ch01 Graphics"
50+
- href: mentat_collective/emmy/debroglie.qmd
51+
text: "deBroglie Waves"
52+
- href: mentat_collective/emmy/silcm_ch01.qmd
53+
text: "Lorentz Covariant"
2754

2855
format:
2956
html:
@@ -32,6 +59,7 @@ format:
3259
dark: [ darkly, brand, styles.scss, styles-dark.scss ]
3360
respect-user-color-scheme: true
3461
lightbox: true
62+
include-after-body: zulip_script.html
3563
include-in-header:
3664
- text: |
3765
<script data-goatcounter="https://clojurecivitas.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>

site/db.edn

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
{:id :kloimhardt
120120
:name "Markus Agwin Kloimwieder"
121121
:url "https://github.com/kloimhardt"
122+
:image "https://github.com/kloimhardt.png"
122123
:affiliation [:scicloj]}
123124
{:id :edwardaw
124125
:name "Edward Widjaja"
@@ -135,17 +136,22 @@
135136
:links [{:icon "github" :href "https://github.com/tombarys"}]}
136137
{:id :mattb
137138
:name "Matthias Buehlmaier"
139+
:url "https://github.com/buehlmaier"
140+
:image "https://github.com/buehlmaier.png"
138141
:affiliation [:cim]}
139142
{:id :tanvi
140143
:name "Tanvi Nagar"
141144
:email "tanvi@connect.hku.hk"
142145
:affiliation [:cim]}
143146
{:id :luke-zeitlin
144147
:name "Luke Zeitlin"
148+
:url "https://github.com/larzeitlin"
149+
:image "https://github.com/larzeitlin.png"
145150
:affiliation []}
146151
{:id :ludgersolbach
147152
:name "Ludger Solbach"
148153
:url "https://github.com/lsolbach"
154+
:image "https://github.com/lsolbach.png"
149155
:links [{:icon "github" :href "https://github.com/lsolbach"}]
150156
:affiliation []}
151157
{:id :bsless
@@ -170,7 +176,22 @@
170176
:image "https://avatars.githubusercontent.com/burinc"
171177
:links [{:icon "github" :href "https://github.com/burinc"}]
172178
:affiliation []}
173-
,]
179+
{:id :proffitt
180+
:name "William Proffitt"
181+
:url "https://github.com/doogiecode"
182+
:image "https://avatars.githubusercontent.com/doogiecode"}
183+
{:id :jclaggett
184+
:name "Jonathan Claggett"
185+
:image "https://avatars.githubusercontent.com/u/100909?v=4"
186+
:url "https://github.com/jclaggett"
187+
:links [{:icon "github" :href "https://github.com/jclaggett"}]}
188+
{:id :rafd
189+
:name "Rafal Dittwald"
190+
:image "https://avatars.githubusercontent.com/u/89664?v=4"
191+
:affiliation [:clojurecamp]
192+
:url "https://github.com/rafd"
193+
:links [{:icon "github" :href "https://github.com/rafd"}]}
194+
]
174195

175196
:affiliation
176197
[{:id :clojure.core

0 commit comments

Comments
 (0)