Skip to content

Commit b7a7828

Browse files
committed
feat: overhaul for relaunch
- Update .gitignore. - Enhance Makefile. - `data` target rebuilds datasets. - `incremental` target rebuilds notebooks that have changed. - Rename existing lessons to be lesson/dd_specific.py (two digits). - Fix bug in scripts/build.py's handling of YAML headers. - Import SQL tutorial. - Add scripts to regenerate SQLite databases. - Build `marimo_learn` package (separate repository) with utilities to localize SQLite database files. - Add tutorial on queueing theory.
1 parent ff3a291 commit b7a7828

57 files changed

Lines changed: 6980 additions & 133 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,6 @@ __marimo__
175175

176176
# Generated site content
177177
_site/
178+
179+
# Editors
180+
*~

.typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ extend-ignore-re = [
1515

1616
# Words to explicitly accept
1717
[default.extend-words]
18+
bimap = "bimap"
1819
pn = "pn"
20+
setp = "setp"
1921

2022
# You can also exclude specific files or directories if needed
2123
# [files]

Makefile

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,38 @@
1+
DATA := \
2+
sql/public/lab.db \
3+
sql/public/penguins.db \
4+
sql/public/survey.db
5+
6+
NOTEBOOK_DIR := \
7+
daft \
8+
duckdb \
9+
functional \
10+
optimization \
11+
polars \
12+
probability \
13+
python \
14+
sql
15+
16+
NOTEBOOK_SRC := $(foreach dir,$(NOTEBOOK_DIR),$(wildcard $(dir)/*.py))
17+
18+
NOTEBOOK_OUT := $(patsubst %.py,_site/%.html,$(NOTEBOOK_SRC))
19+
120
# Default target.
221
all : commands
322

423
## commands : show all commands.
524
commands :
625
@grep -h -E '^##' ${MAKEFILE_LIST} | sed -e 's/## //g' | column -t -s ':'
726

27+
## data: rebuild datasets
28+
data: ${DATA}
29+
30+
## incremental: only rebuild out-of-date parts of the site
31+
incremental: ${NOTEBOOK_OUT}
32+
833
## install: install minimal required packages into current environment.
934
install:
10-
uv pip install marimo jinja2 markdown
35+
uv pip install faker jinja2 markdown marimo python-frontmatter ruff
1136

1237
## build: build entire site.
1338
build:
@@ -18,7 +43,36 @@ build:
1843
serve:
1944
uv run python -m http.server --directory _site
2045

46+
## ---: ---
47+
2148
## clean: clean up stray files.
2249
clean:
2350
@find . -name '*~' -exec rm {} +
2451
@find . -name '.DS_Store' -exec rm {} +
52+
53+
## settings: show variables
54+
settings:
55+
@echo DATA ${DATA}
56+
@echo NOTEBOOK_DIR ${NOTEBOOK_DIR}
57+
@echo NOTEBOOK_SRC ${NOTEBOOK_SRC}
58+
@echo NOTEBOOK_OUT ${NOTEBOOK_OUT}
59+
60+
# subsidiary targets
61+
62+
_site/%.html: %.py
63+
uv run marimo export html-wasm --force --mode edit $< -o $@ --sandbox
64+
65+
sql/public/lab.db: scripts/create_sql_lab.sql
66+
@rm -f $@
67+
@mkdir -p sql/public
68+
sqlite3 $@ < $<
69+
70+
sql/public/penguins.db: scripts/create_sql_penguins.py data/penguins.csv
71+
@rm -f $@
72+
@mkdir -p sql/public
73+
python $< data/penguins.csv $@
74+
75+
sql/public/survey.db: scripts/create_sql_survey.py
76+
@rm -f $@
77+
@mkdir -p sql/public
78+
python $< $@ 192837

0 commit comments

Comments
 (0)