-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: WebAssembly Notebooks, Publishing to the Web (#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>
- Loading branch information
1 parent
ced11b6
commit 5025a89
Showing
15 changed files
with
484 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Community Cloud | ||
|
||
Our [Community Cloud](https://marimo.io/dashboard) is a free workspace | ||
for creating, saving, and sharing marimo notebooks. Unlike the | ||
[Playground](../playground.md), the Community Cloud requires a login. In | ||
return, it lets you save noteoboks, share them using email-based authorization, | ||
and upload a limited amount of data. | ||
|
||
!!! note "WebAssembly notebooks only" | ||
|
||
Currently, the Community Cloud only allows the creation of [WebAssembly | ||
notebooks](../../wasm.md). These are easy to share and embed in other | ||
web pages, but have some limitations in packages and performance. | ||
|
||
Note: unlike our other publishing options, it is not possible to embed | ||
editable Community Cloud notebooks in other web pages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Deploy on backends | ||
|
||
If you cannot use WebAssembly notebooks, you can deploy marimo notebooks via a | ||
traditional client-server model. | ||
|
||
Both the edit server can be deployed as well as individual notebooks (as | ||
readonly apps). | ||
|
||
Learn more in our [Deployment Guide](../deploying/index.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Embedding | ||
|
||
There are various ways to embed marimo notebooks in other web pages, such | ||
as web documentation, educational platforms, or static sites in general. Here | ||
are two ways: | ||
|
||
* Host on [GitHub Pages](github_pages.md) or [self-host WASM HTML](self_host_wasm.md), | ||
and `<iframe>` the published notebook. | ||
* `<iframe>` a playground notebook, and [customize the embedding](playground.md#embedding-in-other-web-pages) with query params. | ||
(This is what we do throughout docs.marimo.io.) | ||
|
||
We plan to provide more turn-key solutions for static site generation with | ||
marimo notebooks in the future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Publish to GitHub Pages | ||
|
||
You can publish executable notebooks to [GitHub Pages](https://pages.github.com/) | ||
for free, after exporting your notebook to a WebAssembly notebook. | ||
|
||
## Export to WASM-powered HTML | ||
|
||
Export your notebook to a self-contained HTML file that runs using [WebAssembly](../wasm.md): | ||
|
||
/// tab | Export as a readonly app | ||
|
||
```bash | ||
marimo export html-wasm notebook.py -o output_dir --mode run | ||
``` | ||
|
||
/// | ||
|
||
/// tab | Export as an editable notebook | ||
|
||
```bash | ||
marimo export html-wasm notebook.py -o output_dir --mode edit | ||
``` | ||
|
||
/// | ||
|
||
See our [exporting guide](../exporting.md#export-to-wasm-powered-html) for | ||
the full documentation. | ||
|
||
## Publish using GitHub Actions | ||
|
||
/// tip | Template repository | ||
|
||
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, | ||
for editable or readonly respectively. | ||
/// | ||
|
||
Publish to GitHub Pages using the following GitHub Actions workflow, | ||
which will republish your notebook on git push. | ||
|
||
```yaml | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# ... checkout and install dependencies | ||
|
||
- name: 📄 Export notebook | ||
run: | | ||
marimo export html-wasm notebook.py -o path/to/output --mode run | ||
- name: 📦 Upload Pages Artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: path/to/output | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: 🌐 Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 | ||
with: | ||
artifact_name: github-pages | ||
``` | ||
## Publish manually | ||
You can also publish an exported notebook manually, through your repository | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Publishing notebooks to the web | ||
|
||
You can publish marimo notebooks to the web as interactive editable notebooks, | ||
readonly web apps, or [static documents](../exporting.md). | ||
|
||
Thanks to [WebAssembly](../wasm.md), you can even share executable | ||
notebooks on GitHub Pages or other static sites without paying for backend | ||
infrastrcture. This makes it easy to share your work with colleagues, embed | ||
executable notebooks in web documentation or educational websites, and more. | ||
|
||
This guide provides an overview of the various ways to publish marimo notebooks. | ||
|
||
| Guide | Description | | ||
| ----------------------------------------------------- | ------------------------------------------------------------ | | ||
| [Embedding](embedding.md) | An overview of embedding notebooks in other sites | | ||
| [GitHub Pages](github_pages.md) | Publishing interactive notebooks on GitHub Pages | | ||
| [Online playground](playground.md) | Sharing notebook links using our online playground | | ||
| [Community Cloud](community_cloud/index.md) | Save notebooks to our free Community Cloud | | ||
| [Self-host WebAssembly notebooks](self_host_wasm.md) | Self-hosting interactive WebAssembly (HTML export) notebooks | | ||
| [View notebooks on GitHub](view_outputs_on_github.md) | Viewing notebook outputs on GitHub | | ||
| [Deploy on a backend](deploy.md) | Deploying notebooks on backends | |
Oops, something went wrong.