Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

Control flow API page (#72)

Akshay Agrawal2ab532aff954
diff --git a/docs/api/misc.md b/docs/api/control_flow.md
similarity index 52%
rename from docs/api/misc.md
rename to docs/api/control_flow.md
index 2748d34282..f23e84bd6d 100644
--- a/docs/api/misc.md
+++ b/docs/api/control_flow.md
@@ -1,6 +1,5 @@
-# Misc
+# Control flow
-## Control flow
Use `mo.stop` to halt execution of a cell, and optionally output an object.
This function is useful for validating user input.
@@ -12,14 +11,12 @@ This function is useful for validating user input.
.. autoclass:: marimo.MarimoStopError
```
-## Debugging
-Use `mo.defs` and `mo.refs` to get the global definitions and references of
-a cell.
+Use `mo.ui.refresh` to trigger other cells to run periodically, on a configurable
+interval (or on click).
```{eval-rst}
-.. autofunction:: marimo.defs
-```
+.. autoclass:: marimo.ui.refresh
+ :members:
-```{eval-rst}
-.. autofunction:: marimo.refs
+ .. autoclasstoc:: marimo._plugins.ui._impl.refresh.refresh
```
diff --git a/docs/api/debugging.md b/docs/api/debugging.md
new file mode 100644
index 0000000000..326e481747
--- /dev/null
+++ b/docs/api/debugging.md
@@ -0,0 +1,12 @@
+# Debugging
+
+Use `mo.defs` and `mo.refs` to get the global definitions and references of
+a cell.
+
+```{eval-rst}
+.. autofunction:: marimo.defs
+```
+
+```{eval-rst}
+.. autofunction:: marimo.refs
+```
diff --git a/docs/api/index.md b/docs/api/index.md
index b215bcbe67..332bd2de19 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -10,22 +10,24 @@
layouts/index
media/index
html
+ control_flow
state
- misc
+ debugging
```
-The marimo library comes with UI elements that you can use to make your data
-tangible and build applications. Some elements like sliders and dropdowns are
-interactive and can be used to collect user input and drive execution, while
-others are static and can be used to display or layout information like
-markdown and tabs.
+Use the marimo library in marimo notebooks (`import marimo as mo`) to connect
+interactive components like sliders, dropdowns, and tables to Python, layout
+information with tabs or grids, output media like images and audio, express
+yourself with dynamically created markdown (parametrized by Python values!),
+and more.
-| | |
-| :------------------- | :---------------------------------------------------------------- |
-| {doc}`markdown` | Write markdown with `mo.md` |
-| {doc}`inputs/index` | Seamlessly connect sliders, dropdowns, tables, and more to Python |
-| {doc}`layouts/index` | Customize outputs with accordions, tabs, stacks, and more |
-| {doc}`media/index` | Output media like images and audio |
-| {doc}`html` | Working with HTML objects |
-| {doc}`state` | Using reactive state |
-| {doc}`misc` | Miscellaneous utilities |
+| | |
+| :------------------- | :-------------------------------------------------------- |
+| {doc}`markdown` | Write markdown with `mo.md` |
+| {doc}`inputs/index` | Connect sliders, dropdowns, tables, and more to Python |
+| {doc}`layouts/index` | Customize outputs with accordions, tabs, stacks, and more |
+| {doc}`media/index` | Output media like images, audio, and PDFs |
+| {doc}`html` | Manipulate HTML objects |
+| {doc}`control_flow` | Control how cells execute |
+| {doc}`state` | Make stateful apps with `mo.state` |
+| {doc}`debugging` | Debugging utilities |