4
4
push :
5
5
branches : [ main, master ]
6
6
paths :
7
- - ' **/* .py' # Trigger on Python file changes
7
+ - ' data_science_tools/polars_vs_pandas .py' # Only trigger on changes to this specific file
8
8
workflow_dispatch : # Allow manual triggering
9
9
10
10
jobs :
@@ -27,52 +27,15 @@ jobs:
27
27
# Install any other dependencies needed by your notebooks
28
28
pip install pandas numpy polars
29
29
30
- - name : Find and export marimo notebooks
30
+ - name : Export marimo notebook
31
31
run : |
32
- mkdir -p _site
32
+ mkdir -p _site/data_science_tools
33
33
34
- # Find all marimo notebooks (Python files with marimo imports)
35
- MARIMO_FILES=$(grep -l "import marimo" $(find . -name "* .py" ! -path "./venv/*" ! -path "./.github/*") || echo "")
34
+ # Export the specific notebook to HTML
35
+ marimo export "data_science_tools/polars_vs_pandas .py" --format html --output "_site/data_science_tools/polars_vs_pandas.html"
36
36
37
- if [ -z "$MARIMO_FILES" ]; then
38
- echo "No marimo notebooks found."
39
- exit 0
40
- fi
41
-
42
- # Export each notebook to HTML
43
- for file in $MARIMO_FILES; do
44
- echo "Processing $file"
45
- # Extract directory and filename
46
- filename=$(basename "$file" .py)
47
- directory=$(dirname "$file")
48
- output_dir="_site/${directory#./}"
49
-
50
- # Create output directory
51
- mkdir -p "$output_dir"
52
-
53
- # Export to HTML
54
- marimo export "$file" --format html --output "$output_dir/$filename.html"
55
-
56
- # If this is in the root directory, create a copy for easy access
57
- if [ "$directory" = "." ]; then
58
- cp "$output_dir/$filename.html" "_site/$filename.html"
59
- fi
60
- done
61
-
62
- # Create an index.html that lists all exported notebooks
63
- echo "<html><head><title>Marimo Notebooks</title><style>body{font-family:sans-serif;max-width:800px;margin:0 auto;padding:20px}h1{color:#0066cc}ul{list-style-type:none;padding:0}li{margin:10px 0;padding:10px;border:1px solid #eee;border-radius:5px}a{color:#0066cc;text-decoration:none}a:hover{text-decoration:underline}</style></head><body><h1>Marimo Notebooks</h1><ul>" > _site/index.html
64
-
65
- find _site -name "*.html" ! -name "index.html" | sort | while read notebook; do
66
- rel_path="${notebook#_site/}"
67
- name=$(basename "$notebook" .html)
68
- dir=$(dirname "$rel_path")
69
- if [ "$dir" = "." ]; then
70
- dir="Root"
71
- fi
72
- echo "<li><strong>$dir/</strong> <a href=\"$rel_path\">$name</a></li>" >> _site/index.html
73
- done
74
-
75
- echo "</ul></body></html>" >> _site/index.html
37
+ # Create a simple index.html
38
+ echo "<html><head><title>Marimo Notebooks</title><style>body{font-family:sans-serif;max-width:800px;margin:0 auto;padding:20px}h1{color:#0066cc}</style></head><body><h1>Marimo Notebooks</h1><p><a href=\"data_science_tools/polars_vs_pandas.html\">Polars vs Pandas</a></p></body></html>" > _site/index.html
76
39
77
40
- name : Deploy to GitHub Pages
78
41
uses : JamesIves/github-pages-deploy-action@v4
0 commit comments