Skip to content

Commit f3382e3

Browse files
authored
docs: clean up organization (#7464)
* Update organization of user guide to follow a better logical flow * Pin mkdocs due to an upstream issue * Other changes for clarity
1 parent 4f72abd commit f3382e3

File tree

8 files changed

+108
-135
lines changed

8 files changed

+108
-135
lines changed

docs/guides/debugging.md

Lines changed: 42 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,16 @@
1-
# Debugging marimo notebooks
1+
# Debugging
22

3-
## Debugging in marimo
3+
## In the marimo editor
44

5-
### Using pdb in marimo notebooks
5+
### Setting breakpoints with pdb
66

7-
marimo has direct support for pdb, the Python debugger. You can set breakpoints
8-
in your code using the built-in `breakpoint()` function. When the code
9-
execution reaches a breakpoint, it will pause, and you can inspect variables,
10-
step through the code, and evaluate expressions.
7+
marimo supports pdb, the Python debugger. Set breakpoints in your code using
8+
the built-in `breakpoint()` function. When the code execution reaches a
9+
breakpoint, it will pause, and you can inspect variables, step through the
10+
code, and evaluate expressions.
1111

12-
Here's an example of how to use `breakpoint()` in a marimo notebook cell.
13-
14-
![PDB in marimo](../_static/docs-pdb-demo.png)
15-
16-
Type `help` in the debugger for a list of commands:
17-
18-
```txt
19-
Documented commands (type help <topic>):
20-
========================================
21-
EOF cl disable ignore n return u where
22-
a clear display interact next retval unalias
23-
alias commands down j p run undisplay
24-
args condition enable jump pp rv unt
25-
b cont exceptions l q s until
26-
break continue exit list quit source up
27-
bt d h ll r step w
28-
c debug help longlist restart tbreak whatis
29-
30-
Miscellaneous help topics:
31-
==========================
32-
exec pdb
33-
```
34-
35-
!!! note
36-
Since this block is runnable, you can test the debugger directly
12+
Here's a live example of how to use `breakpoint()` in a marimo notebook cell. Type
13+
`help` in the debugger for a list of commands.
3714

3815
/// marimo-embed
3916

@@ -52,11 +29,18 @@ def _():
5229
return
5330
```
5431

32+
5533
///
5634

57-
!!! tip
35+
!!! warning "The debugger blocks execution"
36+
37+
When the debugger is active, you cannot execute cells. Remember to continue
38+
or quit the debugger to avoid hanging the notebook!
39+
40+
??? note "Adding breakpoints in the stack trace"
5841
Click the little bug icon in the stack trace to add breakpoints.
59-
<video autoplay muted loop playsinline width="100%" align="center" src="/_static/docs-pdb-breakpoint.webm" alt="Animation showing how to click the bug icon to add PDB breakpoints">
42+
43+
<video muted controls playsinline width="100%" align="center" src="/_static/docs-pdb-breakpoint.webm" alt="Animation showing how to click the bug icon to add PDB breakpoints">
6044
</video>
6145
Clicking on the cell link will also take you to the cell where the error occurred.
6246

@@ -66,25 +50,24 @@ If your code raises an exception, you can use postmortem debugging to inspect
6650
the state of the program at the point where the exception occurred. Click on
6751
the "Launch debugger" button as shown below:
6852

69-
<video autoplay muted loop playsinline width="100%" align="center" src="/_static/docs-postmortem-debugging.webm" alt="Video demonstrating postmortem debugging with the Launch debugger button">
53+
<video muted controls playsinline width="100%" align="center" src="/_static/docs-postmortem-debugging.webm" alt="Video demonstrating postmortem debugging with the Launch debugger button">
7054
</video>
7155

56+
## Debugging notebooks as scripts
7257

73-
!!! note
74-
Other tools like the following will also work in marimo notebooks:
75-
76-
```python
77-
import code
78-
code.interact()
79-
return
80-
```
58+
Since marimo notebooks are standard Python files, you can run them as scripts
59+
from the command line. The following command will run your marimo notebook and
60+
drop you into the pdb debugger if an exception occurs, or if you hit a
61+
breakpoint.
8162

82-
!!! danger
83-
Remember to continue or quit the debugger to avoid hanging the notebook!
63+
```bash
64+
python -m pdb your_script.py
65+
```
8466

85-
## Tips for debugging marimo notebooks with AI
67+
## Debugging with AI
8668

87-
marimo provides built-in integration with AI assistants to help debug your notebooks more effectively.
69+
marimo provides built-in integration with AI assistants to help you debug your
70+
notebooks.
8871

8972
### Ask about notebook errors
9073

@@ -117,26 +100,17 @@ advice.
117100
concepts like reactive execution, cell dependencies, and the differences
118101
between marimo notebooks and traditional Jupyter notebooks.
119102

120-
## Debugging notebooks as a script
121-
Since marimo notebooks are standard Python files, you can run them as scripts
122-
from the command line. The following command will run your marimo notebook and
123-
drop you into the pdb debugger if an exception occurs, or if you hit a
124-
breakpoint.
125-
126-
```bash
127-
python -m pdb your_script.py
128-
```
129-
130-
## External IDE debugging with `debugpy`
103+
## Integrating with external IDEs
131104

132-
marimo supports debugging with IDEs, like VSCode, which natively support the
105+
marimo supports debugging with IDEs, like VS Code, which natively support the
133106
`debugpy` library. This allows you to set breakpoints, step through code, and
134107
inspect variables directly from your IDE.
135108

136-
### Script mode
137-
You can debug marimo notebooks in VSCode using the following `launch.json`.
138-
This launch configuration will debug a marimo notebook in [script
139-
mode](./scripts.md).
109+
### Running as scripts
110+
111+
You can debug marimo notebooks in VS Code using the following `launch.json`.
112+
This launch configuration will debug a marimo notebook executing it as a
113+
[script](./scripts.md).
140114

141115
```json
142116
{
@@ -155,9 +129,10 @@ mode](./scripts.md).
155129
}
156130
```
157131

158-
### Edit mode
132+
### Interactive development
133+
159134
Edit mode debugging allows the marimo editor to trigger breakpoints set in an
160-
IDE like VSCode. Running in this mode will automatically start your notebook in
135+
IDE like VS Code. Running in this mode will automatically start your notebook in
161136
[watch mode](./editor_features/watching.md). Note that the file state and
162137
editor must be consistent for break points to correctly work. If debugging is
163138
not acting as expected, force a notebook save and toggle the relevant
@@ -185,18 +160,12 @@ Use the following `launch.json` configuration to enable edit mode debugging:
185160
}
186161
```
187162

188-
<video autoplay muted loop playsinline width="100%" align="center" src="/_static/docs-debugpy-edit-mode.webm" alt="Video showing debugpy edit mode debugging with VSCode hitting marimo breakpoints">
163+
<video muted controls loop playsinline width="100%" align="center" src="/_static/docs-debugpy-edit-mode.webm" alt="Video showing debugpy edit mode debugging with VS Code hitting marimo breakpoints">
189164
</video>
190165

191166
!!! note
192167
This will disable marimo's internal debugging features.
193168

194169
!!! danger
195-
This mode is blocking in VSCode, so you will need to interact with the
170+
This mode is blocking in VS Code, so you will need to interact with the
196171
debugger in your editor to regain control of the marimo notebook.
197-
198-
199-
## Debug directly in VSCode
200-
201-
!!! note
202-
LSP support for marimo notebooks is coming soon, along with native debug server integration.

docs/guides/editor_features/watching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ the marimo editor or running application. This lets you edit your notebook
77
using an editor of your choice, like neovim, VSCode, Cursor, or PyCharm, and
88
have the changes automatically reflected in your browser.
99

10-
/// admonition | Prefer VS Code/Cursor?
10+
/// admonition | Prefer VS Code/Cursor? Try our extension!
1111
type: tip
1212

1313
This guide teaches you how to use marimo with arbitrary text editors.

docs/guides/lint_rules/index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Lint Rules
22

3-
marimo includes a comprehensive linting system that helps you write better, more reliable notebooks. The linter checks for various issues that could prevent your notebook from running correctly or cause confusion.
3+
marimo includes a linter that helps you write better notebooks. The linter
4+
checks for various issues that could prevent your notebook from running
5+
correctly or cause confusion.
46

5-
## How to Use
7+
## Usage
68

7-
You can run the linter using the CLI:
9+
Run the linter using the CLI:
810

911
```bash
1012
# Check all notebooks in current directory

docs/guides/publishing/embedding.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ are the main approaches:
77
* Host on [GitHub Pages](github_pages.md) or [self-host WASM HTML](self_host_wasm.md),
88
and `<iframe>` the published notebook.
99
* `<iframe>` a [playground](playground.md) notebook, and [customize the embedding](playground.md#embedding-in-other-web-pages) with query params.
10-
(This is what we do throughout docs.marimo.io.)
10+
(This is what we do throughout https://docs.marimo.io.)
1111
* Use the [marimo snippets](from_code_snippets.md) plugin to replace code snippets in HTML or markdown with interactive notebooks.
1212

13-
We plan to provide more turn-key solutions for static site generation with
14-
marimo notebooks in the future.
15-
1613
## Iframe Sandbox Configuration
1714

1815
When embedding marimo notebooks in sandboxed iframes, proper configuration is essential for full functionality. marimo is designed to gracefully degrade when certain features are restricted, but understanding these requirements will help you provide the best experience.

docs/guides/publishing/from_github.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ data stored in your GitHub repo to the notebook's filesystem, making it
66
easy to bundle data with your notebooks.
77

88

9+
- [Share molab links](https://molab.marimo.io/github) to notebooks hosted on GitHub
910
- Publish notebooks to [GitHub Pages](github_pages.md)
1011
- Edit notebooks on the [marimo playground](playground.md), with public link-based sharing
1112
(no login required!)
12-
- Synchronize to our [Community Cloud](community_cloud/index.md) for email-based sharing

docs/guides/publishing/index.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
# Publishing notebooks to the web
22

33
You can publish marimo notebooks to the web as interactive editable notebooks,
4-
readonly web apps, or [static documents](../exporting.md).
5-
6-
Thanks to [WebAssembly](../wasm.md), you can even share executable
7-
notebooks on GitHub Pages or other static sites without paying for backend
8-
infrastrcture. This makes it easy to share your work with colleagues, embed
9-
executable notebooks in web documentation or educational websites, and more.
4+
readonly web apps, or [static documents](../exporting.md). Thanks to
5+
[WebAssembly](../wasm.md), you can even share executable notebooks on GitHub
6+
Pages or other static sites without paying for backend infrastrcture. This
7+
makes it easy to share your work with colleagues, embed executable notebooks in
8+
web documentation or educational websites, and more.
109

1110
This guide provides an overview of the various ways to publish marimo notebooks.
1211

12+
!!! tip "Share cloud-hosted notebooks with molab"
13+
14+
For a turn-key sharing experience, use [molab](https://molab.marimo.io/notebooks),
15+
our free cloud-hosted marimo notebook
16+
17+
1318
| Guide | Description |
1419
| ----------------------------------------------------- | ------------------------------------------------------------ |
1520
| [Embedding](embedding.md) | An overview of embedding notebooks in other sites |
1621
| [From GitHub](from_github.md) | Share links to executable notebooks hosted on GitHub |
1722
| [From code snippets](from_code_snippets.md) | Convert code snippets in Markdown or HTML to interactive notebooks |
1823
| [GitHub Pages](github_pages.md) | Publish interactive notebooks on GitHub Pages |
1924
| [Cloudflare](cloudflare.md) | Publish interactive notebooks on Cloudflare |
20-
| [Online playground](playground.md) | Share links to notebooks using our online playground |
21-
| [Community Cloud](community_cloud/index.md) | Save notebooks to our free Community Cloud |
2225
| [Self-host WebAssembly notebooks](self_host_wasm.md) | Self-hosting interactive WebAssembly (HTML export) notebooks |
26+
| [Online playground](playground.md) | Share links to notebooks using our online playground |
2327
| [View notebooks on GitHub](view_outputs_on_github.md) | Viewing notebook outputs on GitHub |
2428
| [Deploy on a backend](deploy.md) | Deploying notebooks on backends |
25-
| [With MkDocs](mkdocs.md) | Publish reactive websites with MkDocs from markdown |
2629
| [With Quarto](quarto.md) | Publish reactive websites with Quarto from markdown |

0 commit comments

Comments
 (0)