You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: WebAssembly Notebooks, Publishing to the Web (marimo-team#3389)
Update the documentation to reflect various new developments with
WebAssembly notebooks, and also add a new guide on publishing notebooks
to the web.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy file name to clipboardexpand all lines: docs/guides/exporting.md
+10-45
Original file line number
Diff line number
Diff line change
@@ -149,8 +149,12 @@ Options:
149
149
150
150
!!! note "Note"
151
151
152
-
The exported file must be served over HTTP to function correctly - it cannot be opened directly from the filesystem (file://).
153
-
Your server must also serve the assets in the `assets` directory, next to the HTML file. For this reason, we recommend using the online playground if possible: <https://marimo.app>.
152
+
The exported file must be served over HTTP to function correctly - it
153
+
cannot be opened directly from the filesystem (`file://`). Your server must
154
+
also serve the assets in the `assets` directory, next to the HTML file. For
155
+
a simpler publishing experience, publish to [GitHub
156
+
Pages](publishing/github_pages.md) or use the [online
157
+
playground](publishing/playground.md).
154
158
155
159
### Testing the export
156
160
@@ -161,51 +165,12 @@ cd path/to/output_dir
161
165
python -m http.server
162
166
```
163
167
164
-
### Deploying to GitHub Pages
168
+
### Publishing to GitHub Pages
165
169
166
-
/// admonition | Template repository
167
-
type: tip
170
+
After exporting your notebook to WASM HTML, you can publish it to
171
+
[GitHub Pages](https://pages.github.com/) for free. See our [guide on
172
+
GitHub Pages](publishing/github_pages.md) to learn more.
168
173
169
-
You can fork our [template repository](https://github.com/marimo-team/marimo-gh-pages-template) for deploying multiple notebooks to GitHub Pages. Once you have forked the repository, add your notebooks to the `notebooks`/`apps` directory.
170
-
///
171
-
172
-
You can deploy your WebAssembly marimo notebook to GitHub Pages using the following GitHub Actions workflow:
173
-
174
-
```yaml
175
-
jobs:
176
-
build:
177
-
runs-on: ubuntu-latest
178
-
179
-
steps:
180
-
# ... checkout and install dependencies
181
-
182
-
- name: 📄 Export notebook
183
-
run: |
184
-
marimo export html-wasm notebook.py -o path/to/output --mode run
See our [exporting guide](../exporting.md#export-to-wasm-powered-html) for
27
+
the full documentation.
28
+
29
+
## Publish using GitHub Actions
30
+
31
+
/// tip | Template repository
32
+
33
+
Fork our [template repository](https://github.com/marimo-team/marimo-gh-pages-template) for deploying multiple notebooks to GitHub Pages. Once you have forked the repository, add your notebooks to the `notebooks` or `apps` directories,
34
+
for editable or readonly respectively.
35
+
///
36
+
37
+
Publish to GitHub Pages using the following GitHub Actions workflow,
38
+
which will republish your notebook on git push.
39
+
40
+
```yaml
41
+
jobs:
42
+
build:
43
+
runs-on: ubuntu-latest
44
+
45
+
steps:
46
+
# ... checkout and install dependencies
47
+
48
+
- name: 📄 Export notebook
49
+
run: |
50
+
marimo export html-wasm notebook.py -o path/to/output --mode run
51
+
52
+
- name: 📦 Upload Pages Artifact
53
+
uses: actions/upload-pages-artifact@v3
54
+
with:
55
+
path: path/to/output
56
+
57
+
deploy:
58
+
needs: build
59
+
runs-on: ubuntu-latest
60
+
environment:
61
+
name: github-pages
62
+
url: ${{ steps.deployment.outputs.page_url }}
63
+
64
+
permissions:
65
+
pages: write
66
+
id-token: write
67
+
68
+
steps:
69
+
- name: 🌐 Deploy to GitHub Pages
70
+
id: deployment
71
+
uses: actions/deploy-pages@v4
72
+
with:
73
+
artifact_name: github-pages
74
+
```
75
+
76
+
## Publish manually
77
+
78
+
You can also publish an exported notebook manually, through your repository
79
+
settings. Read [GitHub's documentation](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) to learn more.
0 commit comments