File tree Expand file tree Collapse file tree 4 files changed +78
-71
lines changed Expand file tree Collapse file tree 4 files changed +78
-71
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy to GitHub Pages
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ deploy :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@v4
14
+
15
+ - name : Deploy
16
+ uses : peaceiris/actions-gh-pages@v4
17
+ if : github.ref == 'refs/heads/main'
18
+ with :
19
+ github_token : ${{ secrets.GITHUB_TOKEN }}
20
+ publish_dir : ./build
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -42,24 +42,37 @@ uv run marimo edit notebook.py --sandbox
42
42
43
43
### Publishing Notebooks
44
44
45
- Add the following workflow to ` .github/workflows/publish-marimo.yml ` :
46
-
47
- ``` yaml
48
- ...
49
- jobs :
50
- publish :
51
- runs-on : ubuntu-latest
52
- steps :
53
- ...
54
- - name : Export notebook
55
- run : |
56
- uv run marimo export html notebook.py -o build/notebook.html --sandbox
57
- ...
58
- ```
45
+ To export your marimo notebooks to HTML locally:
46
+
47
+ 1 . Make sure the ` export_notebook.sh ` script is executable:
48
+
49
+ ``` bash
50
+ chmod +x export_notebook.sh
51
+ ```
52
+
53
+ 2 . Run the script with your notebook name:
54
+
55
+ ``` bash
56
+ # For notebooks in the root directory
57
+ ./export_notebook.sh notebook_name
58
+
59
+ # For notebooks in subdirectories
60
+ ./export_notebook.sh path/to/notebook_name
61
+ ```
62
+
63
+ For example:
64
+
65
+ ``` bash
66
+ ./export_notebook.sh data_science_tools/polars_vs_pandas
67
+ ./export_notebook.sh llm/pydantic_ai_examples
68
+ ```
69
+
70
+ The exported HTML files will be automatically deployed to GitHub Pages through the GitHub Actions workflow.
59
71
60
72
## Pull Request Process
61
73
62
74
1 . Fork the repository
63
75
2 . Create a new branch for your feature
64
76
3 . Make your changes
65
- 4 . Submit a pull request with a clear description of changes
77
+ 4 . Submit a pull request with a clear description of changes
78
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Check if a notebook name was provided
4
+ if [ -z " $1 " ]; then
5
+ echo " Error: Please provide a notebook name"
6
+ echo " Usage: ./export_notebook.sh notebook_name"
7
+ exit 1
8
+ fi
9
+
10
+ # Get the notebook name without .py extension if provided
11
+ notebook_name=${1% .py}
12
+
13
+ # Get the directory path
14
+ dir_path=$( dirname " $notebook_name " )
15
+ notebook_base=$( basename " $notebook_name " )
16
+
17
+ # Create build directory and subdirectories if they don't exist
18
+ mkdir -p " build/$dir_path "
19
+
20
+ # Export the notebook to HTML
21
+ echo " Exporting $notebook_name .py to HTML..."
22
+ uv run marimo export html " $notebook_name .py" -o " build/$notebook_name .html" --sandbox
23
+
24
+ # Check if the export was successful
25
+ if [ $? -eq 0 ]; then
26
+ echo " Successfully exported $notebook_name .py to build/$notebook_name .html"
27
+ else
28
+ echo " Error: Failed to export notebook"
29
+ exit 1
30
+ fi
You can’t perform that action at this time.
0 commit comments