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.

fix: simplify markdown (#7005)

Dylan Madisettif4436b03268a
diff --git a/examples/ai/chat/anthropic_example.py b/examples/ai/chat/anthropic_example.py
index b911cbb0ba..d738feb24d 100644
--- a/examples/ai/chat/anthropic_example.py
+++ b/examples/ai/chat/anthropic_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -74,9 +74,9 @@ def _(key, mo):
@app.cell
def _(mo):
- mo.md(
- """Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history)."""
- )
+ mo.md("""
+ Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
+ """)
return
diff --git a/examples/ai/chat/bedrock_example.py b/examples/ai/chat/bedrock_example.py
index 231d462acb..acc1a54870 100644
--- a/examples/ai/chat/bedrock_example.py
+++ b/examples/ai/chat/bedrock_example.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -160,7 +160,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md(r"""## AWS Bedrock Chat""")
+ mo.md(r"""
+ ## AWS Bedrock Chat
+ """)
return
diff --git a/examples/ai/chat/custom.py b/examples/ai/chat/custom.py
index 172f55cbce..60e459636d 100644
--- a/examples/ai/chat/custom.py
+++ b/examples/ai/chat/custom.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -51,7 +51,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md("""Access the chatbot's historical messages with `chatbot.value`.""")
+ mo.md("""
+ Access the chatbot's historical messages with `chatbot.value`.
+ """)
return
diff --git a/examples/ai/chat/deepseek_example.py b/examples/ai/chat/deepseek_example.py
index 5a1700e691..97c44e1045 100644
--- a/examples/ai/chat/deepseek_example.py
+++ b/examples/ai/chat/deepseek_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -86,9 +86,9 @@ def _(key, mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history)."""
- )
+ mo.md("""
+ Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
+ """)
return
diff --git a/examples/ai/chat/gemini.py b/examples/ai/chat/gemini.py
index 0a244f9ba6..989ee77915 100644
--- a/examples/ai/chat/gemini.py
+++ b/examples/ai/chat/gemini.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -68,9 +68,9 @@ def _(key, mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history)."""
- )
+ mo.md("""
+ Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
+ """)
return
diff --git a/examples/ai/chat/groq_example.py b/examples/ai/chat/groq_example.py
index 60ac7be088..b030f4fcc3 100644
--- a/examples/ai/chat/groq_example.py
+++ b/examples/ai/chat/groq_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -86,9 +86,9 @@ def _(key, mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history)."""
- )
+ mo.md("""
+ Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
+ """)
return
diff --git a/examples/ai/chat/llm_datasette.py b/examples/ai/chat/llm_datasette.py
index 8cb2c85c3e..40e2b78eff 100644
--- a/examples/ai/chat/llm_datasette.py
+++ b/examples/ai/chat/llm_datasette.py
@@ -8,19 +8,23 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Using <https://llm.datasette.io> with `mo.ui.chat()`""")
+ mo.md(r"""
+ ## Using <https://llm.datasette.io> with `mo.ui.chat()`
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""To set a key, run: `llm keys set openai` in your terminal""")
+ mo.md("""
+ To set a key, run: `llm keys set openai` in your terminal
+ """)
return
diff --git a/examples/ai/chat/mlx_chat.py b/examples/ai/chat/mlx_chat.py
index a71b2801f2..d4eda62a64 100644
--- a/examples/ai/chat/mlx_chat.py
+++ b/examples/ai/chat/mlx_chat.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -192,7 +192,9 @@ def _(generate, max_tokens, mo, model, system_message, temp_slider, tokenizer):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""Access the chatbot's historical messages with `chatbot.value`.""")
+ mo.md("""
+ Access the chatbot's historical messages with `chatbot.value`.
+ """)
return
diff --git a/examples/ai/chat/openai_example.py b/examples/ai/chat/openai_example.py
index c6ff383bd2..8556a126b0 100644
--- a/examples/ai/chat/openai_example.py
+++ b/examples/ai/chat/openai_example.py
@@ -8,7 +8,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -73,9 +73,9 @@ def _(mo, openai_key):
@app.cell
def _(mo):
- mo.md(
- """Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history)."""
- )
+ mo.md("""
+ Access the chatbot's historical messages with [`chatbot.value`](https://docs.marimo.io/api/inputs/chat.html#accessing-chat-history).
+ """)
return
diff --git a/examples/ai/chat/simplemind_example.py b/examples/ai/chat/simplemind_example.py
index c4c6413d77..2ce3e1eb7c 100644
--- a/examples/ai/chat/simplemind_example.py
+++ b/examples/ai/chat/simplemind_example.py
@@ -8,15 +8,15 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="full")
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""## Using [simplemind](https://github.com/kennethreitz/simplemind) with `mo.ui.chat()`"""
- )
+ mo.md(r"""
+ ## Using [simplemind](https://github.com/kennethreitz/simplemind) with `mo.ui.chat()`
+ """)
return
diff --git a/examples/ai/data/data_labeler.py b/examples/ai/data/data_labeler.py
index 7b4a124e20..595e4dc7af 100644
--- a/examples/ai/data/data_labeler.py
+++ b/examples/ai/data/data_labeler.py
@@ -1,12 +1,14 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell
def _(mo):
- mo.md("# Data Labeler")
+ mo.md("""
+ # Data Labeler
+ """)
return
@@ -36,7 +38,9 @@ def _(decrement_index, increment_index, mo):
@app.cell
def _(mo):
- mo.md(f"**Choose an example to label.**")
+ mo.md(f"""
+ **Choose an example to label.**
+ """)
return
diff --git a/examples/ai/data/model_comparison.py b/examples/ai/data/model_comparison.py
index 441da3e14f..fd8fba15c6 100644
--- a/examples/ai/data/model_comparison.py
+++ b/examples/ai/data/model_comparison.py
@@ -7,13 +7,15 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Model Comparison""")
+ mo.md("""
+ # Model Comparison
+ """)
return
@@ -61,7 +63,9 @@ def _(NUMBER_OF_EXAMPLES, get_index, mo, set_index):
@app.cell(hide_code=True)
def _(mo):
- mo.md(f"_Models A and B both predict spans. Which do you prefer?_")
+ mo.md(f"""
+ _Models A and B both predict spans. Which do you prefer?_
+ """)
return
diff --git a/examples/ai/misc/build_a_superhero.py b/examples/ai/misc/build_a_superhero.py
index 0ef92f8462..86c0784449 100644
--- a/examples/ai/misc/build_a_superhero.py
+++ b/examples/ai/misc/build_a_superhero.py
@@ -8,13 +8,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Build a Superhero with Generative AI""")
+ mo.md("""
+ ## Build a Superhero with Generative AI
+ """)
return
diff --git a/examples/ai/misc/micrograd_mlp.py b/examples/ai/misc/micrograd_mlp.py
index af9aeffa0f..cfaf37dd17 100644
--- a/examples/ai/misc/micrograd_mlp.py
+++ b/examples/ai/misc/micrograd_mlp.py
@@ -11,13 +11,15 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Neural Networks with Micrograd""")
+ mo.md("""
+ # Neural Networks with Micrograd
+ """)
return
diff --git a/examples/ai/misc/pdf_question_answer.py b/examples/ai/misc/pdf_question_answer.py
index aea684b8dc..6210b6b8b1 100644
--- a/examples/ai/misc/pdf_question_answer.py
+++ b/examples/ai/misc/pdf_question_answer.py
@@ -9,19 +9,23 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell
def _(mo):
- mo.md("""# PDF Q&A""")
+ mo.md("""
+ # PDF Q&A
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""This app lets you upload a PDF and ask questions about it.""")
+ mo.md("""
+ This app lets you upload a PDF and ask questions about it.
+ """)
return
diff --git a/examples/ai/tools/chat_with_tools.py b/examples/ai/tools/chat_with_tools.py
index c05fad44ae..14d3337bc5 100644
--- a/examples/ai/tools/chat_with_tools.py
+++ b/examples/ai/tools/chat_with_tools.py
@@ -16,7 +16,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -45,7 +45,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md(r"""## Setup""")
+ mo.md(r"""
+ ## Setup
+ """)
return
@@ -104,7 +106,9 @@ def _(data, dataset_dropdown, pl):
@app.cell
def _(mo):
- mo.md(r"""## Defining tools""")
+ mo.md(r"""
+ ## Defining tools
+ """)
return
diff --git a/examples/cloud/gcp/google_cloud_bigquery.py b/examples/cloud/gcp/google_cloud_bigquery.py
index 5902f2a8ec..058175cd09 100644
--- a/examples/cloud/gcp/google_cloud_bigquery.py
+++ b/examples/cloud/gcp/google_cloud_bigquery.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -24,7 +24,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Google Cloud BigQuery""")
+ mo.md("""
+ # Google Cloud BigQuery
+ """)
return
diff --git a/examples/cloud/modal/nbs/notebook.py b/examples/cloud/modal/nbs/notebook.py
index fc2ee06d27..0afe70cd44 100644
--- a/examples/cloud/modal/nbs/notebook.py
+++ b/examples/cloud/modal/nbs/notebook.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -15,7 +15,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Hello, from inside Modal!""")
+ mo.md("""
+ # Hello, from inside Modal!
+ """)
return
@@ -47,7 +49,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Runtime information""")
+ mo.md("""
+ ## Runtime information
+ """)
return
diff --git a/examples/layouts/columns.py b/examples/layouts/columns.py
index 63b7d3f101..699ee3bd31 100644
--- a/examples/layouts/columns.py
+++ b/examples/layouts/columns.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="columns")
@@ -90,7 +90,9 @@ def _(raw_digits):
@app.cell(column=1, hide_code=True)
def _(mo):
- mo.md("""# Embedding Visualizer""")
+ mo.md("""
+ # Embedding Visualizer
+ """)
return
diff --git a/examples/layouts/grid-dashboard.py b/examples/layouts/grid-dashboard.py
index 52c1f6c92f..9467b3c3d0 100644
--- a/examples/layouts/grid-dashboard.py
+++ b/examples/layouts/grid-dashboard.py
@@ -15,7 +15,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(
width="medium",
layout_file="layouts/grid-dashboard.grid.json",
@@ -24,7 +24,9 @@ app = marimo.App(
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Gapminder Dashboard""")
+ mo.md(r"""
+ # Gapminder Dashboard
+ """)
return
@@ -57,7 +59,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Getting the data""")
+ mo.md(r"""
+ # Getting the data
+ """)
return
@@ -112,7 +116,9 @@ def _(dataset):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Charting the data""")
+ mo.md(r"""
+ # Charting the data
+ """)
return
@@ -292,13 +298,17 @@ def _(HEIGHT, altair_view, hvplot_view, mo, mpl_view, plotly_view):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Building a dashboard""")
+ mo.md(r"""
+ # Building a dashboard
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Creating widgets""")
+ mo.md("""
+ ## Creating widgets
+ """)
return
@@ -354,7 +364,9 @@ def _(YEARS, autoplay, set_year):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Creating the charts, reactive to the widgets""")
+ mo.md(r"""
+ ## Creating the charts, reactive to the widgets
+ """)
return
diff --git a/examples/layouts/slides.py b/examples/layouts/slides.py
index c66bc0ed65..3eb559a853 100644
--- a/examples/layouts/slides.py
+++ b/examples/layouts/slides.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium", layout_file="layouts/slides.slides.json")
@@ -50,7 +50,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md(r"""# Creating the example data set""")
+ mo.md(r"""
+ # Creating the example data set
+ """)
return
@@ -89,7 +91,9 @@ def _(duckdb, mo, print_and_run):
@app.cell
def _(mo):
- mo.md(r"""# Pretty-printing floating-point numbers""")
+ mo.md(r"""
+ # Pretty-printing floating-point numbers
+ """)
return
@@ -123,7 +127,9 @@ def _(mo, print_and_run):
@app.cell
def _(mo):
- mo.md(r"""# Copying the schema of a table""")
+ mo.md(r"""
+ # Copying the schema of a table
+ """)
return
@@ -159,7 +165,9 @@ def _(mo, print_and_run):
@app.cell
def _(mo):
- mo.md(r"""# Shuffling data""")
+ mo.md(r"""
+ # Shuffling data
+ """)
return
diff --git a/examples/markdown/admonitions.py b/examples/markdown/admonitions.py
index 0eaee146fd..6b2188d29b 100644
--- a/examples/markdown/admonitions.py
+++ b/examples/markdown/admonitions.py
@@ -1,14 +1,14 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""Use **admonitions** in markdown to bring attention to text. Here are some examples."""
- )
+ mo.md(r"""
+ Use **admonitions** in markdown to bring attention to text. Here are some examples.
+ """)
return
diff --git a/examples/markdown/details.py b/examples/markdown/details.py
index 0ae04e0a64..4927a75ec3 100644
--- a/examples/markdown/details.py
+++ b/examples/markdown/details.py
@@ -1,12 +1,14 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""Create expandable markdown blocks with `details`:""")
+ mo.md(r"""
+ Create expandable markdown blocks with `details`:
+ """)
return
@@ -24,7 +26,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""Style details using the "type" argument:""")
+ mo.md(r"""
+ Style details using the "type" argument:
+ """)
return
diff --git a/examples/markdown/dynamic_markdown.py b/examples/markdown/dynamic_markdown.py
index 8c27130825..044979a88c 100644
--- a/examples/markdown/dynamic_markdown.py
+++ b/examples/markdown/dynamic_markdown.py
@@ -1,14 +1,14 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""Use `mo.md` with an `f-string` to create markdown that depends on the value of Python objects."""
- )
+ mo.md(r"""
+ Use `mo.md` with an `f-string` to create markdown that depends on the value of Python objects.
+ """)
return
@@ -30,7 +30,9 @@ def _(mo, name):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""Embed marimo UI elements in markdown directly:""")
+ mo.md(r"""
+ Embed marimo UI elements in markdown directly:
+ """)
return
@@ -54,9 +56,9 @@ def _(mo, text_input):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""Wrap plots and data structures in `mo.as_html()` to hook into marimo's rich media viewer:"""
- )
+ mo.md(r"""
+ Wrap plots and data structures in `mo.as_html()` to hook into marimo's rich media viewer:
+ """)
return
diff --git a/examples/markdown/emoji.py b/examples/markdown/emoji.py
index 57a59c9c9b..5a2ea3463f 100644
--- a/examples/markdown/emoji.py
+++ b/examples/markdown/emoji.py
@@ -1,18 +1,22 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""Use colon syntax as a shortcut for **emojis** in your markdown.""")
+ mo.md(r"""
+ Use colon syntax as a shortcut for **emojis** in your markdown.
+ """)
return
@app.cell
def _(mo):
- mo.md(r""":rocket: :smile:""")
+ mo.md(r"""
+ :rocket: :smile:
+ """)
return
diff --git a/examples/misc/colliding_blocks_and_pi.py b/examples/misc/colliding_blocks_and_pi.py
index 3d6cb4f5bc..b9ab4a56be 100644
--- a/examples/misc/colliding_blocks_and_pi.py
+++ b/examples/misc/colliding_blocks_and_pi.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -39,7 +39,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Simulate!""")
+ mo.md("""
+ ## Simulate!
+ """)
return
diff --git a/examples/misc/compound_interest.py b/examples/misc/compound_interest.py
index 3462741f6b..3989ec148d 100644
--- a/examples/misc/compound_interest.py
+++ b/examples/misc/compound_interest.py
@@ -8,13 +8,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Compound Interest""")
+ mo.md("""
+ # Compound Interest
+ """)
return
diff --git a/examples/misc/create_your_own_shape.py b/examples/misc/create_your_own_shape.py
index 87eded14b8..48ab300791 100644
--- a/examples/misc/create_your_own_shape.py
+++ b/examples/misc/create_your_own_shape.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -23,7 +23,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md(r"""## Text boxes""")
+ mo.md(r"""
+ ## Text boxes
+ """)
return
@@ -63,7 +65,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md(r"""## Sliders""")
+ mo.md(r"""
+ ## Sliders
+ """)
return
@@ -85,7 +89,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md(r"""## Checkboxes and Radios""")
+ mo.md(r"""
+ ## Checkboxes and Radios
+ """)
return
@@ -156,7 +162,9 @@ def _(COLORS, colors, mo, shape):
@app.cell
def _(mo):
- mo.md("""## Dates""")
+ mo.md("""
+ ## Dates
+ """)
return
@@ -190,7 +198,9 @@ def _(end_date, mo, start_date):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Dropdowns""")
+ mo.md("""
+ ## Dropdowns
+ """)
return
diff --git a/examples/misc/explore_your_own_data.py b/examples/misc/explore_your_own_data.py
index be844e9f24..fd57d52dd9 100644
--- a/examples/misc/explore_your_own_data.py
+++ b/examples/misc/explore_your_own_data.py
@@ -10,13 +10,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App(width="full")
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Data Explorer""")
+ mo.md("""
+ # Data Explorer
+ """)
return
diff --git a/examples/misc/filterable_table.py b/examples/misc/filterable_table.py
index 88c8486fb8..8dd420a3de 100644
--- a/examples/misc/filterable_table.py
+++ b/examples/misc/filterable_table.py
@@ -8,13 +8,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Filterable DataFrame""")
+ mo.md(r"""
+ # Filterable DataFrame
+ """)
return
diff --git a/examples/misc/monotonic_splines.py b/examples/misc/monotonic_splines.py
index 4fe0ff0cf7..bd2c602837 100644
--- a/examples/misc/monotonic_splines.py
+++ b/examples/misc/monotonic_splines.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -127,15 +127,17 @@ def _(degree, knots, n_knots):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""When you then take these generated features and pass them to a linear model, you should be able to see that we're indeed able to fit a very non-linear curve with a linear model."""
- )
+ mo.md(r"""
+ When you then take these generated features and pass them to a linear model, you should be able to see that we're indeed able to fit a very non-linear curve with a linear model.
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""... turn into these features:""")
+ mo.md(r"""
+ ... turn into these features:
+ """)
return
@@ -181,9 +183,9 @@ def _(plt, x_range, x_range_tfm):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""Note the correspondence between the lines here. The color in the chart above has a direct correspondence with the line below."""
- )
+ mo.md(r"""
+ Note the correspondence between the lines here. The color in the chart above has a direct correspondence with the line below.
+ """)
return
diff --git a/examples/misc/mortgage_calculator.py b/examples/misc/mortgage_calculator.py
index 6001486a45..ed76c4d655 100644
--- a/examples/misc/mortgage_calculator.py
+++ b/examples/misc/mortgage_calculator.py
@@ -10,19 +10,23 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Mortgage Calculator""")
+ mo.md("""
+ # Mortgage Calculator
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Income""")
+ mo.md("""
+ ## Income
+ """)
return
@@ -217,7 +221,9 @@ def _(
@app.cell
def _(mo):
- mo.md("""## Monthly Expenses""")
+ mo.md("""
+ ## Monthly Expenses
+ """)
return
diff --git a/examples/misc/pokemon_stats.py b/examples/misc/pokemon_stats.py
index 9b00d2f543..dc796e549b 100644
--- a/examples/misc/pokemon_stats.py
+++ b/examples/misc/pokemon_stats.py
@@ -13,13 +13,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App(width="full")
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Pokémon Statistics 📊🔬""")
+ mo.md("""
+ # Pokémon Statistics 📊🔬
+ """)
return
diff --git a/examples/misc/reactive_plots.py b/examples/misc/reactive_plots.py
index 4c218e05fe..db6370f8b5 100644
--- a/examples/misc/reactive_plots.py
+++ b/examples/misc/reactive_plots.py
@@ -9,13 +9,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App(width="full")
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Welcome to marimo!""")
+ mo.md("""
+ # Welcome to marimo!
+ """)
return
diff --git a/examples/misc/seam_carving.py b/examples/misc/seam_carving.py
index 9b096a26c5..09e0dc76af 100644
--- a/examples/misc/seam_carving.py
+++ b/examples/misc/seam_carving.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -58,7 +58,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Try it!""")
+ mo.md("""
+ ## Try it!
+ """)
return
diff --git a/examples/outputs/conditional_output.py b/examples/outputs/conditional_output.py
index 4d9eb50afe..adda40c421 100644
--- a/examples/outputs/conditional_output.py
+++ b/examples/outputs/conditional_output.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -19,7 +19,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""Use inline if expressions to conditionally show a value""")
+ mo.md("""
+ Use inline if expressions to conditionally show a value
+ """)
return
@@ -49,7 +51,9 @@ def _(checkbox, mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""A value of `None` produces the empty output:""")
+ mo.md("""
+ A value of `None` produces the empty output:
+ """)
return
diff --git a/examples/outputs/plots.py b/examples/outputs/plots.py
index fe0be22e6d..3761fd108b 100644
--- a/examples/outputs/plots.py
+++ b/examples/outputs/plots.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -27,7 +27,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md("""Output a plot object, such as an axis or figure, to see the plot.""")
+ mo.md("""
+ Output a plot object, such as an axis or figure, to see the plot.
+ """)
return
diff --git a/examples/sql/connect_to_motherduck.py b/examples/sql/connect_to_motherduck.py
index 681499174f..c0a3b9b766 100644
--- a/examples/sql/connect_to_motherduck.py
+++ b/examples/sql/connect_to_motherduck.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -57,7 +57,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md("""Let's attach a remote MotherDuck database using `md:`""")
+ mo.md("""
+ Let's attach a remote MotherDuck database using `md:`
+ """)
return
@@ -85,7 +87,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md(r"""## Let's make some queries 🦆""")
+ mo.md(r"""
+ ## Let's make some queries 🦆
+ """)
return
@@ -298,7 +302,9 @@ def _(alt, hn_type_select, most_monthly_voted):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Additional Reactivity ⚡⚡""")
+ mo.md("""
+ ## Additional Reactivity ⚡⚡
+ """)
return
diff --git a/examples/sql/connect_to_persistent_db.py b/examples/sql/connect_to_persistent_db.py
index 17014210b1..16a99c25cd 100644
--- a/examples/sql/connect_to_persistent_db.py
+++ b/examples/sql/connect_to_persistent_db.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -12,9 +12,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """Connect to duckdb [persistent storage](https://duckdb.org/docs/connect/overview.html#persistent-database) using the `ATTACH` command:"""
- )
+ mo.md("""
+ Connect to duckdb [persistent storage](https://duckdb.org/docs/connect/overview.html#persistent-database) using the `ATTACH` command:
+ """)
return
diff --git a/examples/sql/connect_to_sqlite.py b/examples/sql/connect_to_sqlite.py
index a8423b1756..c9860c7ae2 100644
--- a/examples/sql/connect_to_sqlite.py
+++ b/examples/sql/connect_to_sqlite.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -91,9 +91,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""Once the database is attached, you can query it with SQL. For example, the next cell computes the average track length of each composer in the chinook database."""
- )
+ mo.md(r"""
+ Once the database is attached, you can query it with SQL. For example, the next cell computes the average track length of each composer in the chinook database.
+ """)
return
diff --git a/examples/sql/histograms.py b/examples/sql/histograms.py
index a1690acad4..20b31c1069 100644
--- a/examples/sql/histograms.py
+++ b/examples/sql/histograms.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -83,9 +83,9 @@ def _(column, mo):
@app.cell
def _(mo):
- mo.md(
- r"""Now we will take the histogram result and plot it using [Altair](https://altair-viz.github.io/)."""
- )
+ mo.md(r"""
+ Now we will take the histogram result and plot it using [Altair](https://altair-viz.github.io/).
+ """)
return
diff --git a/examples/sql/misc/database_explorer.py b/examples/sql/misc/database_explorer.py
index 58a6751f20..929a559ee6 100644
--- a/examples/sql/misc/database_explorer.py
+++ b/examples/sql/misc/database_explorer.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="full")
@@ -70,7 +70,9 @@ def _(duckdb):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Tables""")
+ mo.md(r"""
+ ## Tables
+ """)
return
@@ -86,7 +88,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Other meta table functions""")
+ mo.md(r"""
+ ## Other meta table functions
+ """)
return
@@ -136,7 +140,9 @@ def _(function, mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Interact with your tables""")
+ mo.md(r"""
+ ## Interact with your tables
+ """)
return
diff --git a/examples/sql/misc/electric_vehicles.py b/examples/sql/misc/electric_vehicles.py
index 55e0c74034..e4ccc40849 100644
--- a/examples/sql/misc/electric_vehicles.py
+++ b/examples/sql/misc/electric_vehicles.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -104,7 +104,9 @@ def _(chart1, chart2, mo):
@app.cell
def _(mo):
- mo.md(r"""## Appendix""")
+ mo.md(r"""
+ ## Appendix
+ """)
return
diff --git a/examples/sql/misc/sql_cars.py b/examples/sql/misc/sql_cars.py
index b209162ff7..86c6f47b0c 100644
--- a/examples/sql/misc/sql_cars.py
+++ b/examples/sql/misc/sql_cars.py
@@ -12,7 +12,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -77,7 +77,9 @@ def _(mo, origin_filter, top_n, year_range):
@app.cell
def _(mo):
- mo.md("""### Breakdown by Origin""")
+ mo.md("""
+ ### Breakdown by Origin
+ """)
return
diff --git a/examples/sql/parametrizing_sql_queries.py b/examples/sql/parametrizing_sql_queries.py
index 6dce5bdd6b..77c6d3a5ea 100644
--- a/examples/sql/parametrizing_sql_queries.py
+++ b/examples/sql/parametrizing_sql_queries.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -44,7 +44,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""Next, we create a dropdown that selects the iris species.""")
+ mo.md(r"""
+ Next, we create a dropdown that selects the iris species.
+ """)
return
diff --git a/examples/sql/read_csv.py b/examples/sql/read_csv.py
index 7d33f8bcf6..122b45e33e 100644
--- a/examples/sql/read_csv.py
+++ b/examples/sql/read_csv.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -36,9 +36,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """Reading from a local CSV is as easy as `SELECT * from "data.csv"`, where `data.csv` is the path to your local file (or a URL to a CSV file)."""
- )
+ mo.md("""
+ Reading from a local CSV is as easy as `SELECT * from "data.csv"`, where `data.csv` is the path to your local file (or a URL to a CSV file).
+ """)
return
@@ -131,15 +131,17 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Advanced usage""")
+ mo.md(r"""
+ ## Advanced usage
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""To customize how your CSV is read, including specifying the delimiter type, use [duckdb's `read_csv` function](https://duckdb.org/docs/data/csv/overview.html)."""
- )
+ mo.md(r"""
+ To customize how your CSV is read, including specifying the delimiter type, use [duckdb's `read_csv` function](https://duckdb.org/docs/data/csv/overview.html).
+ """)
return
diff --git a/examples/sql/read_json.py b/examples/sql/read_json.py
index a2476864ab..d9ce30470e 100644
--- a/examples/sql/read_json.py
+++ b/examples/sql/read_json.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -137,15 +137,17 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Advanced usage""")
+ mo.md(r"""
+ ## Advanced usage
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""To customize how your json file is read, use [duckdb's `read_json` function](https://duckdb.org/docs/data/json/overview.html)."""
- )
+ mo.md(r"""
+ To customize how your json file is read, use [duckdb's `read_json` function](https://duckdb.org/docs/data/json/overview.html).
+ """)
return
diff --git a/examples/sql/read_parquet.py b/examples/sql/read_parquet.py
index 2656f56f2b..9783cca9f1 100644
--- a/examples/sql/read_parquet.py
+++ b/examples/sql/read_parquet.py
@@ -11,7 +11,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -36,9 +36,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """Reading from a Parquet file is as easy as `SELECT * from "data.parquet"`, where `data.parquet` is the path or URL to your parquet file."""
- )
+ mo.md("""
+ Reading from a Parquet file is as easy as `SELECT * from "data.parquet"`, where `data.parquet` is the path or URL to your parquet file.
+ """)
return
@@ -130,15 +130,17 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Advanced usage""")
+ mo.md(r"""
+ ## Advanced usage
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""To customize how your parquet file is read, use [duckdb's `read_parquet` function](https://duckdb.org/docs/data/parquet/overview.html)."""
- )
+ mo.md(r"""
+ To customize how your parquet file is read, use [duckdb's `read_parquet` function](https://duckdb.org/docs/data/parquet/overview.html).
+ """)
return
diff --git a/examples/third_party/chroma/multimodal_retrieval.py b/examples/third_party/chroma/multimodal_retrieval.py
index 92a14343f9..265e55176e 100644
--- a/examples/third_party/chroma/multimodal_retrieval.py
+++ b/examples/third_party/chroma/multimodal_retrieval.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -167,9 +167,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""We create a collection with the embedding function and data loader."""
- )
+ mo.md(r"""
+ We create a collection with the embedding function and data loader.
+ """)
return
@@ -283,9 +283,9 @@ def _(mo, results, selected):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""This example was adapted from [multimodal_retrieval.ipynb](https://github.com/chroma-core/chroma/blob/main/examples/multimodal/multimodal_retrieval.ipynb), using `marimo convert`."""
- )
+ mo.md(r"""
+ This example was adapted from [multimodal_retrieval.ipynb](https://github.com/chroma-core/chroma/blob/main/examples/multimodal/multimodal_retrieval.ipynb), using `marimo convert`.
+ """)
return
diff --git a/examples/third_party/cvxpy/regularization_and_sparsity.py b/examples/third_party/cvxpy/regularization_and_sparsity.py
index a55d8b7878..d561ebabaa 100644
--- a/examples/third_party/cvxpy/regularization_and_sparsity.py
+++ b/examples/third_party/cvxpy/regularization_and_sparsity.py
@@ -10,13 +10,15 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Regularization and Sparsity""")
+ mo.md("""
+ # Regularization and Sparsity
+ """)
return
@@ -92,7 +94,9 @@ def _(functools, l1_solver, l2_solver, np, sparsity_parameter):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Parameter selection""")
+ mo.md("""
+ ## Parameter selection
+ """)
return
diff --git a/examples/third_party/cvxpy/signals/app.py b/examples/third_party/cvxpy/signals/app.py
index eef00cbcaa..c7779c7aa6 100644
--- a/examples/third_party/cvxpy/signals/app.py
+++ b/examples/third_party/cvxpy/signals/app.py
@@ -1,12 +1,14 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell
def _(mo):
- mo.md("# Signal Decomposition")
+ mo.md("""
+ # Signal Decomposition
+ """)
return
@@ -335,7 +337,9 @@ def _(
@app.cell
def _(mo):
- mo.md("## Part 2: More Decompositions")
+ mo.md("""
+ ## Part 2: More Decompositions
+ """)
return
diff --git a/examples/third_party/cvxpy/signals/examples.py b/examples/third_party/cvxpy/signals/examples.py
index 2dc698b025..4cd12939ce 100644
--- a/examples/third_party/cvxpy/signals/examples.py
+++ b/examples/third_party/cvxpy/signals/examples.py
@@ -1,24 +1,30 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell
def _(mo):
- mo.md("# Examples")
+ mo.md("""
+ # Examples
+ """)
return
@app.cell
def _(mo):
- mo.md("## Real Data")
+ mo.md("""
+ ## Real Data
+ """)
return
@app.cell
def _(mo):
- mo.md("### NOAA CO2")
+ mo.md("""
+ ### NOAA CO2
+ """)
return
@@ -56,7 +62,9 @@ def _(co2_df, co2_problem, mo, plt):
@app.cell
def _(mo):
- mo.md("### Solar power generation")
+ mo.md("""
+ ### Solar power generation
+ """)
return
@@ -88,13 +96,17 @@ def _(mo, pv_df, solutions):
@app.cell
def _(mo):
- mo.md("## Synthetic Data")
+ mo.md("""
+ ## Synthetic Data
+ """)
return
@app.cell
def _(mo):
- mo.md("### Basic changepoint detection")
+ mo.md("""
+ ### Basic changepoint detection
+ """)
return
@@ -111,7 +123,9 @@ def _(dataloaders, mo, plt):
@app.cell
def _(mo):
- mo.md("**Exact, nonconvex version**")
+ mo.md("""
+ **Exact, nonconvex version**
+ """)
return
@@ -132,7 +146,9 @@ def _(bcd_X_real, bcd_y, mo, solutions):
@app.cell
def _(mo):
- mo.md("**Heuristic, convex version**")
+ mo.md("""
+ **Heuristic, convex version**
+ """)
return
@@ -149,7 +165,9 @@ def _(bcd_X_real, bcd_y, mo, solutions):
@app.cell
def _(mo):
- mo.md("### Harder changepoint detection")
+ mo.md("""
+ ### Harder changepoint detection
+ """)
return
@@ -180,7 +198,9 @@ def _(hcd_X_real, hcd_y, mo, solutions):
@app.cell
def _(mo):
- mo.md("### Synthetic soiling data")
+ mo.md("""
+ ### Synthetic soiling data
+ """)
return
diff --git a/examples/third_party/cvxpy/smallest_enclosing_circle.py b/examples/third_party/cvxpy/smallest_enclosing_circle.py
index 8463385907..d63e8d965b 100644
--- a/examples/third_party/cvxpy/smallest_enclosing_circle.py
+++ b/examples/third_party/cvxpy/smallest_enclosing_circle.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -101,7 +101,9 @@ def _(plt):
@app.cell
def _(mo):
- mo.md("""## The solution method""")
+ mo.md("""
+ ## The solution method
+ """)
return
diff --git a/examples/third_party/databricks/databricks_connect.py b/examples/third_party/databricks/databricks_connect.py
index e784891aa2..e7e87784d4 100644
--- a/examples/third_party/databricks/databricks_connect.py
+++ b/examples/third_party/databricks/databricks_connect.py
@@ -9,13 +9,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Using `databcricks_connect`""")
+ mo.md(r"""
+ # Using `databcricks_connect`
+ """)
return
diff --git a/examples/third_party/matplotlib/mandelbrot.py b/examples/third_party/matplotlib/mandelbrot.py
index 734dc81a25..6c44904195 100644
--- a/examples/third_party/matplotlib/mandelbrot.py
+++ b/examples/third_party/matplotlib/mandelbrot.py
@@ -9,13 +9,15 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# The Mandelbrot Set""")
+ mo.md("""
+ # The Mandelbrot Set
+ """)
return
diff --git a/examples/third_party/matplotlib/surfaces.py b/examples/third_party/matplotlib/surfaces.py
index 32bd8d759a..f5a19dd029 100644
--- a/examples/third_party/matplotlib/surfaces.py
+++ b/examples/third_party/matplotlib/surfaces.py
@@ -9,13 +9,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Surfaces""")
+ mo.md("""
+ # Surfaces
+ """)
return
@@ -153,7 +155,9 @@ def _(plt):
@app.cell
def _(mo):
- mo.md("""### Controls""")
+ mo.md("""
+ ### Controls
+ """)
return
diff --git a/examples/third_party/plotly/image_selection.py b/examples/third_party/plotly/image_selection.py
index d397db2401..2b1105a308 100644
--- a/examples/third_party/plotly/image_selection.py
+++ b/examples/third_party/plotly/image_selection.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App(width="full")
@@ -25,7 +25,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md("""#Example: Image with range selection""")
+ mo.md("""
+ #Example: Image with range selection
+ """)
return
@@ -58,7 +60,9 @@ def _(mo, plot):
@app.cell
def _(mo):
- mo.md("""#Example: Image with overlaid trace""")
+ mo.md("""
+ #Example: Image with overlaid trace
+ """)
return
diff --git a/examples/third_party/polars/polars_example.py b/examples/third_party/polars/polars_example.py
index 9ce93c6614..d4082f088b 100644
--- a/examples/third_party/polars/polars_example.py
+++ b/examples/third_party/polars/polars_example.py
@@ -10,7 +10,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="full")
@@ -73,7 +73,9 @@ def _(df, pl, type_1_filter, type_2_filter):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""Select points on the chart 👇""")
+ mo.md(r"""
+ Select points on the chart 👇
+ """)
return
diff --git a/examples/third_party/pyiceberg/data_catalog.py b/examples/third_party/pyiceberg/data_catalog.py
index 2fa9b95297..837e516f10 100644
--- a/examples/third_party/pyiceberg/data_catalog.py
+++ b/examples/third_party/pyiceberg/data_catalog.py
@@ -9,7 +9,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -46,7 +46,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## Connect to a data catalog""")
+ mo.md(r"""
+ ## Connect to a data catalog
+ """)
return
diff --git a/examples/third_party/pymde/complete_graph.py b/examples/third_party/pymde/complete_graph.py
index cdb9312118..6c8b855ff6 100644
--- a/examples/third_party/pymde/complete_graph.py
+++ b/examples/third_party/pymde/complete_graph.py
@@ -8,13 +8,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Visualizing Complete Graphs""")
+ mo.md("""
+ # Visualizing Complete Graphs
+ """)
return
diff --git a/examples/third_party/pymde/drawing_graphs.py b/examples/third_party/pymde/drawing_graphs.py
index ab3deddda5..6a26763271 100644
--- a/examples/third_party/pymde/drawing_graphs.py
+++ b/examples/third_party/pymde/drawing_graphs.py
@@ -7,13 +7,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell
def _(mo):
- mo.md("# Drawing Graphs")
+ mo.md("""
+ # Drawing Graphs
+ """)
return
diff --git a/examples/third_party/pymde/interactive_cluster_analysis.py b/examples/third_party/pymde/interactive_cluster_analysis.py
index 4543c82d31..152a5246a7 100644
--- a/examples/third_party/pymde/interactive_cluster_analysis.py
+++ b/examples/third_party/pymde/interactive_cluster_analysis.py
@@ -8,13 +8,15 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell
def _(mo):
- mo.md("""# Cluster analysis""")
+ mo.md("""
+ # Cluster analysis
+ """)
return
diff --git a/examples/third_party/pymde/rotational_invariance.py b/examples/third_party/pymde/rotational_invariance.py
index aac3bace03..48aea1471f 100644
--- a/examples/third_party/pymde/rotational_invariance.py
+++ b/examples/third_party/pymde/rotational_invariance.py
@@ -7,13 +7,15 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App(width="full")
@app.cell
def _(mo):
- mo.md("# Rotational Invariance of Embeddings")
+ mo.md("""
+ # Rotational Invariance of Embeddings
+ """)
return
diff --git a/examples/third_party/unsloth/llama_3_1_8b_2x_faster_finetuning.py b/examples/third_party/unsloth/llama_3_1_8b_2x_faster_finetuning.py
index f5eb885939..8dda3bd2a9 100644
--- a/examples/third_party/unsloth/llama_3_1_8b_2x_faster_finetuning.py
+++ b/examples/third_party/unsloth/llama_3_1_8b_2x_faster_finetuning.py
@@ -14,7 +14,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="full")
@@ -72,13 +72,17 @@ def _(mo):
@app.cell
def _(mo):
- mo.md("### Load the model")
+ mo.md("""
+ ### Load the model
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""Start by choosing a couple of parameters:""")
+ mo.md("""
+ Start by choosing a couple of parameters:
+ """)
return
@@ -102,9 +106,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""We now add LoRA adapters so we only need to update 1 to 10% of all parameters!"""
- )
+ mo.md(r"""
+ We now add LoRA adapters so we only need to update 1 to 10% of all parameters!
+ """)
return
diff --git a/examples/ui/arrays_and_dicts.py b/examples/ui/arrays_and_dicts.py
index 2bdcdc6b17..e9fbac95af 100644
--- a/examples/ui/arrays_and_dicts.py
+++ b/examples/ui/arrays_and_dicts.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -20,7 +20,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Arrays and Dictionaries""")
+ mo.md("""
+ # Arrays and Dictionaries
+ """)
return
@@ -51,7 +53,9 @@ def _(create):
@app.cell
def _(mo):
- mo.md("""UI Elements ...""")
+ mo.md("""
+ UI Elements ...
+ """)
return
@@ -73,7 +77,9 @@ def _(create, mo, random):
@app.cell
def _(mo):
- mo.md("""... and their values""")
+ mo.md("""
+ ... and their values
+ """)
return
@@ -142,9 +148,9 @@ def _(mo, mo_d, py_d):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""Notice that when you interact with the UI elements in the marimo dict, the reference of marimo dict updates automatically. However, when you interact with the elements in the python dict, you need to manually re-run the cell to see the updated values."""
- )
+ mo.md(r"""
+ Notice that when you interact with the UI elements in the marimo dict, the reference of marimo dict updates automatically. However, when you interact with the elements in the python dict, you need to manually re-run the cell to see the updated values.
+ """)
return
diff --git a/examples/ui/batch_and_form.py b/examples/ui/batch_and_form.py
index a41c2d5ee8..33454291d2 100644
--- a/examples/ui/batch_and_form.py
+++ b/examples/ui/batch_and_form.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -19,7 +19,9 @@ def _():
@app.cell
def _(mo):
- mo.md("""# Batch and Form""")
+ mo.md("""
+ # Batch and Form
+ """)
return
diff --git a/examples/ui/data_editor.py b/examples/ui/data_editor.py
index 5ecc455999..a459cfc9c8 100644
--- a/examples/ui/data_editor.py
+++ b/examples/ui/data_editor.py
@@ -1,6 +1,6 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -38,9 +38,9 @@ def _(DATA_FILE, mo, os):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """The following cell writes the updated dataframe to disk when the submit button is clicked."""
- )
+ mo.md("""
+ The following cell writes the updated dataframe to disk when the submit button is clicked.
+ """)
return
diff --git a/examples/ui/layout.py b/examples/ui/layout.py
index ccc811258c..bc7b15084c 100644
--- a/examples/ui/layout.py
+++ b/examples/ui/layout.py
@@ -7,21 +7,23 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Stacks""")
+ mo.md("""
+ # Stacks
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """Use `mo.hstack` and `mo.vstack` to layout outputs in rows and columns."""
- )
+ mo.md("""
+ Use `mo.hstack` and `mo.vstack` to layout outputs in rows and columns.
+ """)
return
@@ -52,7 +54,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md("""## Horizontal Stack: `hstack`""")
+ mo.md("""
+ ## Horizontal Stack: `hstack`
+ """)
return
@@ -70,7 +74,9 @@ def _(align, boxes, gap, justify, mo, wrap):
@app.cell
def _(mo):
- mo.md("""## Vertical Stack: `vstack`""")
+ mo.md("""
+ ## Vertical Stack: `vstack`
+ """)
return
diff --git a/examples/ui/table_advanced.py b/examples/ui/table_advanced.py
index 7d2f43a4f8..0733b5d0e5 100644
--- a/examples/ui/table_advanced.py
+++ b/examples/ui/table_advanced.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -30,13 +30,17 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""_Create rich tables with selectable rows using_ `mo.ui.table`.""")
+ mo.md("""
+ _Create rich tables with selectable rows using_ `mo.ui.table`.
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""**Single selection.**""")
+ mo.md("""
+ **Single selection.**
+ """)
return
@@ -58,7 +62,9 @@ def _(mo, single_select_table):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""**Multi-selection.**""")
+ mo.md("""
+ **Multi-selection.**
+ """)
return
@@ -80,7 +86,9 @@ def _(mo, multi_select_table):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""**No selection.**""")
+ mo.md("""
+ **No selection.**
+ """)
return
@@ -98,7 +106,9 @@ def _(mo, office_characters):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""**Select individual cells**""")
+ mo.md("""
+ **Select individual cells**
+ """)
return
@@ -111,7 +121,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md("""**Style individual cells**""")
+ mo.md("""
+ **Style individual cells**
+ """)
return
diff --git a/examples/ui/tabs_advanced.py b/examples/ui/tabs_advanced.py
index c47b55d091..82ff6b362e 100644
--- a/examples/ui/tabs_advanced.py
+++ b/examples/ui/tabs_advanced.py
@@ -7,7 +7,7 @@
import marimo
-__generated_with = "0.15.5"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -19,13 +19,17 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Tabs""")
+ mo.md("""
+ # Tabs
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md("""Use `mo.ui.tabs` to organize outputs.""")
+ mo.md("""
+ Use `mo.ui.tabs` to organize outputs.
+ """)
return
diff --git a/frontend/src/core/codemirror/language/__tests__/markdown.test.ts b/frontend/src/core/codemirror/language/__tests__/markdown.test.ts
index 8c2f5b18eb..b9ee0d9687 100644
--- a/frontend/src/core/codemirror/language/__tests__/markdown.test.ts
+++ b/frontend/src/core/codemirror/language/__tests__/markdown.test.ts
@@ -27,8 +27,10 @@ describe("MarkdownLanguageAdapter", () => {
const out = adapter.transformOut(innerCode, metadata);
expect(out).toMatchInlineSnapshot(`
[
- "mo.md(r""" """)",
- 10,
+ "mo.md(r"""
+
+ """)",
+ 12,
]
`);
});
@@ -227,8 +229,10 @@ describe("MarkdownLanguageAdapter", () => {
it("empty string", () => {
const code = "";
const [wrappedCode, offset] = adapter.transformOut(code, metadata);
- expect(wrappedCode).toBe(`mo.md(""" """)`);
- expect(offset).toBe(9);
+ expect(wrappedCode).toBe(`mo.md("""
+
+""")`);
+ expect(offset).toBe(11);
});
it("defaults to r-string when there is no last quote prefix", () => {
@@ -236,15 +240,19 @@ describe("MarkdownLanguageAdapter", () => {
const code = "Hello world";
metadata.quotePrefix = "r";
const [wrappedCode, offset] = adapter.transformOut(code, metadata);
- expect(wrappedCode).toBe(`mo.md(r"""Hello world""")`);
- expect(offset).toBe(10);
+ expect(wrappedCode).toBe(`mo.md(r"""
+Hello world
+""")`);
+ expect(offset).toBe(12);
});
it("single line", () => {
const code = "Hello world";
const [wrappedCode, offset] = adapter.transformOut(code, metadata);
- expect(wrappedCode).toBe(`mo.md("""Hello world""")`);
- expect(offset).toBe(9);
+ expect(wrappedCode).toBe(`mo.md("""
+Hello world
+""")`);
+ expect(offset).toBe(11);
});
it("starts with quote", () => {
@@ -283,21 +291,36 @@ describe("MarkdownLanguageAdapter", () => {
});
it("should escape triple quotes in the Markdown code", () => {
- const code = 'Markdown with an escaped """quote"""!!';
+ const code = 'Markdown with an escaped """quote""""!!';
const [wrappedCode, offset] = adapter.transformOut(code, metadata);
expect(wrappedCode).toBe(
- `mo.md("""Markdown with an escaped \\"""quote\\"""!!""")`,
+ `mo.md("""
+Markdown with an escaped "\\""quote"\\""\\"!!
+""")`,
);
- expect(offset).toBe(9);
+ expect(offset).toBe(11);
+ });
+
+ it("should escape triple quotes in the Markdown code with backslash", () => {
+ const code = 'Markdown with an escaped \\"""quote\\""""!!';
+ const [wrappedCode, offset] = adapter.transformOut(code, metadata);
+ expect(wrappedCode).toBe(
+ `mo.md("""
+Markdown with an escaped \\"\\""quote\\"\\""\\"!!
+""")`,
+ );
+ expect(offset).toBe(11);
});
it("should preserve r strings", () => {
const code = String.raw`$\nu = \mathllap{}\cdot\mathllap{\alpha}$`;
metadata.quotePrefix = "r";
const [wrappedCode, offset] = adapter.transformOut(code, metadata);
- const pythonCode = `mo.md(r"""$\\nu = \\mathllap{}\\cdot\\mathllap{\\alpha}$""")`;
+ const pythonCode = `mo.md(r"""
+$\\nu = \\mathllap{}\\cdot\\mathllap{\\alpha}$
+""")`;
expect(wrappedCode).toBe(pythonCode);
- expect(offset).toBe(10);
+ expect(offset).toBe(12);
});
it("should handle f-strings in transformOut", () => {
diff --git a/frontend/src/core/codemirror/language/__tests__/utils.test.ts b/frontend/src/core/codemirror/language/__tests__/utils.test.ts
index 35d743ae31..8ba5e38e93 100644
--- a/frontend/src/core/codemirror/language/__tests__/utils.test.ts
+++ b/frontend/src/core/codemirror/language/__tests__/utils.test.ts
@@ -146,8 +146,12 @@ describe("splitEditor", () => {
selection: { anchor: "Hello,".length },
});
const result = splitEditor(mockEditor);
- expect(result.beforeCursorCode).toEqual('mo.md("""Hello,""")');
- expect(result.afterCursorCode).toEqual('mo.md(""" World!""")');
+ expect(result.beforeCursorCode).toEqual(`mo.md("""
+Hello,
+""")`);
+ expect(result.afterCursorCode).toEqual(`mo.md("""
+ World!
+""")`);
});
// f-strings not currently supported
diff --git a/marimo/_ast/codegen.py b/marimo/_ast/codegen.py
index 9adecfd558..69e0d160bf 100644
--- a/marimo/_ast/codegen.py
+++ b/marimo/_ast/codegen.py
@@ -148,7 +148,6 @@ def format_markdown(cell: CellImpl) -> str:
# tokenize.
tokens = tokenize.tokenize(io.BytesIO(cell.code.encode("utf-8")).readline)
tag = ""
- quote = '"'
# Comment capture
comments = {
"prefix": "",
@@ -172,9 +171,6 @@ def format_markdown(cell: CellImpl) -> str:
if start[0].lower() in "rtf":
tag += start[0]
start = start[1:]
- quote = start[0]
- if start[:3] == quote * 3:
- quote = start[:3]
fstring = "f" in tag.lower()
elif tok.string == "mo":
key = None
@@ -188,29 +184,18 @@ def format_markdown(cell: CellImpl) -> str:
# on f-strings with values.
markdown = markdown.replace("{", "{{").replace("}", "}}")
- body = construct_markdown_call(markdown, quote, tag)
+ # We always use """ as per front end.
+ body = construct_markdown_call(markdown, '"""', tag)
return "".join([comments["prefix"], body, comments["suffix"]])
def construct_markdown_call(markdown: str, quote: str, tag: str) -> str:
- # If quotes are on either side, we need to use the multiline format.
- quote_type = quote[:1]
- bounded_by_quotes = markdown.startswith(quote_type) or markdown.endswith(
- quote_type
- )
-
- if (len(quote) == 3 and "\n" in markdown) or bounded_by_quotes:
- return "\n".join(
- [
- f"mo.md({tag}{quote}",
- markdown,
- f"{quote})",
- ]
- )
- return format_tuple_elements(
- "mo.md(...)",
- (f"{tag}{quote}{markdown}{quote}",),
- trail_comma=False,
+ return "\n".join(
+ [
+ f"mo.md({tag}{quote}",
+ markdown,
+ f"{quote})",
+ ]
)
diff --git a/marimo/_tutorials/fileformat.py b/marimo/_tutorials/fileformat.py
index 233b51eb0f..feef875bbc 100644
--- a/marimo/_tutorials/fileformat.py
+++ b/marimo/_tutorials/fileformat.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
with app.setup:
@@ -328,7 +328,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""Standalone classes are also exposed:""")
+ mo.md(r"""
+ Standalone classes are also exposed:
+ """)
return
diff --git a/marimo/_tutorials/intro.py b/marimo/_tutorials/intro.py
index 09ccfce051..9d34100de5 100644
--- a/marimo/_tutorials/intro.py
+++ b/marimo/_tutorials/intro.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -195,7 +195,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md("""**🌊 Some UI elements.** Try interacting with the below elements.""")
+ mo.md("""
+ **🌊 Some UI elements.** Try interacting with the below elements.
+ """)
return
@@ -333,7 +335,9 @@ def _(mo, tips):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Finally, a fun fact""")
+ mo.md("""
+ ## Finally, a fun fact
+ """)
return
diff --git a/marimo/_tutorials/layout.py b/marimo/_tutorials/layout.py
index ea272b7cdf..8a79b46595 100644
--- a/marimo/_tutorials/layout.py
+++ b/marimo/_tutorials/layout.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -161,7 +161,9 @@ def _(mo):
@app.cell
def _(mo):
- mo.md("""This markdown is left-justified.""")
+ mo.md("""
+ This markdown is left-justified.
+ """)
return
@@ -201,7 +203,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""An accordion can contain multiple items:""")
+ mo.md("""
+ An accordion can contain multiple items:
+ """)
return
diff --git a/marimo/_tutorials/plots.py b/marimo/_tutorials/plots.py
index 9d0ce5b6cc..7f5e901fb6 100644
--- a/marimo/_tutorials/plots.py
+++ b/marimo/_tutorials/plots.py
@@ -10,13 +10,15 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md("""# Plotting""")
+ mo.md("""
+ # Plotting
+ """)
return
@@ -40,7 +42,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Matplotlib""")
+ mo.md("""
+ ## Matplotlib
+ """)
return
@@ -200,7 +204,9 @@ def _(exponent, mo, plot_power):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Other libraries""")
+ mo.md("""
+ ## Other libraries
+ """)
return
diff --git a/marimo/_tutorials/sql.py b/marimo/_tutorials/sql.py
index 934b88b952..53a5b3625f 100644
--- a/marimo/_tutorials/sql.py
+++ b/marimo/_tutorials/sql.py
@@ -13,7 +13,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App(width="medium")
@@ -130,7 +130,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## Querying dataframes with SQL""")
+ mo.md("""
+ ## Querying dataframes with SQL
+ """)
return
@@ -148,9 +150,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""Let's take a look at a SQL cell. The next cell generates a dataframe called `df`."""
- )
+ mo.md(r"""
+ Let's take a look at a SQL cell. The next cell generates a dataframe called `df`.
+ """)
return
@@ -199,9 +201,9 @@ def _(has_polars_installed):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""Next, we create a SQL query, referencing the Python dataframe `df` directly."""
- )
+ mo.md(r"""
+ Next, we create a SQL query, referencing the Python dataframe `df` directly.
+ """)
return
@@ -221,15 +223,17 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## From Python to SQL and back""")
+ mo.md("""
+ ## From Python to SQL and back
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""You can create SQL statements that depend on Python values, such as UI elements:"""
- )
+ mo.md(r"""
+ You can create SQL statements that depend on Python values, such as UI elements:
+ """)
return
@@ -344,7 +348,9 @@ def _(mo, result, token_prefix):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""## CSVs, Parquet, Postgres, and more ...""")
+ mo.md(r"""
+ ## CSVs, Parquet, Postgres, and more ...
+ """)
return
diff --git a/marimo/_tutorials/ui.py b/marimo/_tutorials/ui.py
index b29d2531b7..aec3d3bf2a 100644
--- a/marimo/_tutorials/ui.py
+++ b/marimo/_tutorials/ui.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.17.2"
+__generated_with = "0.17.4"
app = marimo.App()
@@ -20,7 +20,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""## marimo.ui""")
+ mo.md("""
+ ## marimo.ui
+ """)
return
@@ -92,15 +94,17 @@ def _(mo, slider):
@app.cell(hide_code=True)
def _(mo):
- mo.md("""### Simple elements""")
+ mo.md("""
+ ### Simple elements
+ """)
return
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- """marimo has a [large library of simple UI elements](https://docs.marimo.io/api/inputs/index.html). Here are a just few examples:"""
- )
+ mo.md("""
+ marimo has a [large library of simple UI elements](https://docs.marimo.io/api/inputs/index.html). Here are a just few examples:
+ """)
return
@@ -273,9 +277,9 @@ def _(array):
@app.cell(hide_code=True)
def _(mo):
- mo.md(
- r"""marimo also comes with `mo.ui.dictionary`, which is analogous to `mo.ui.array`"""
- )
+ mo.md(r"""
+ marimo also comes with `mo.ui.dictionary`, which is analogous to `mo.ui.array`
+ """)
return
diff --git a/packages/smart-cells/src/parsers/markdown-parser.ts b/packages/smart-cells/src/parsers/markdown-parser.ts
index 55dd0cd99b..0033917fc2 100644
--- a/packages/smart-cells/src/parsers/markdown-parser.ts
+++ b/packages/smart-cells/src/parsers/markdown-parser.ts
@@ -109,18 +109,11 @@ export class MarkdownParser implements LanguageParser<MarkdownMetadata> {
// We always transform back with triple quotes, as to avoid needing to
// escape single quotes.
- const escapedCode = code.replaceAll('"""', String.raw`\"""`);
-
- // If it's one line and not bounded by quotes, write it as single line
- const isOneLine = !code.includes("\n");
- const boundedByQuote = code.startsWith('"') || code.endsWith('"');
- if (isOneLine && !boundedByQuote) {
- const start = `mo.md(${quotePrefix}"""`;
- const end = `""")`;
- return { code: start + escapedCode + end, offset: start.length };
- }
+ // We escape only 2 because 4 quotes in a row would end the string.
+ // We escape the second quote to avoid leading backslashes escaping the
+ // first quote.
+ const escapedCode = code.replaceAll('""', String.raw`"\"`);
- // Multiline code
const start = `mo.md(${quotePrefix}"""\n`;
const end = `\n""")`;
return { code: start + escapedCode + end, offset: start.length + 1 };
diff --git a/tests/_convert/snapshots/basic_marimo_example_roundtrip.py.txt b/tests/_convert/snapshots/basic_marimo_example_roundtrip.py.txt
index ca05e922ff..67965ec315 100644
--- a/tests/_convert/snapshots/basic_marimo_example_roundtrip.py.txt
+++ b/tests/_convert/snapshots/basic_marimo_example_roundtrip.py.txt
@@ -6,7 +6,9 @@ app = marimo.App(width="medium", app_title="Test Notebook")
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""This is a simple marimo notebook""")
+ mo.md(r"""
+ This is a simple marimo notebook
+ """)
return
diff --git a/tests/_convert/snapshots/convert_hides_markdown_cells.py.txt b/tests/_convert/snapshots/convert_hides_markdown_cells.py.txt
index 536f19a9a1..911f0ed74a 100644
--- a/tests/_convert/snapshots/convert_hides_markdown_cells.py.txt
+++ b/tests/_convert/snapshots/convert_hides_markdown_cells.py.txt
@@ -5,21 +5,27 @@ app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""A markdown cell.""")
+ mo.md(r"""
+ A markdown cell.
+ """)
return
@app.cell(hide_code=True)
def _(mo):
# Cell tags: blah
- mo.md(r"""A markdown cell with tags: ['blah'].""")
+ mo.md(r"""
+ A markdown cell with tags: ['blah'].
+ """)
return
@app.cell(hide_code=True)
def _(mo):
# Cell tags: blah
- mo.md(r"""A markdown cell with tags: ['blah', 'hide-cell'].""")
+ mo.md(r"""
+ A markdown cell with tags: ['blah', 'hide-cell'].
+ """)
return
diff --git a/tests/_convert/snapshots/frontmatter-test.py.txt b/tests/_convert/snapshots/frontmatter-test.py.txt
index bb2785e617..3eb81eb427 100644
--- a/tests/_convert/snapshots/frontmatter-test.py.txt
+++ b/tests/_convert/snapshots/frontmatter-test.py.txt
@@ -9,7 +9,9 @@ app = marimo.App(app_title="My Title")
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# Notebook""")
+ mo.md(r"""
+ # Notebook
+ """)
return
diff --git a/tests/_convert/snapshots/no-frontmatter.py.txt b/tests/_convert/snapshots/no-frontmatter.py.txt
index b4aa7cf9c8..2ca5378e5e 100644
--- a/tests/_convert/snapshots/no-frontmatter.py.txt
+++ b/tests/_convert/snapshots/no-frontmatter.py.txt
@@ -6,7 +6,9 @@ app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# My Notebook""")
+ mo.md(r"""
+ # My Notebook
+ """)
return
diff --git a/tests/_convert/snapshots/pypercent_format.py.txt b/tests/_convert/snapshots/pypercent_format.py.txt
index dd4f247126..532ed2ee7f 100644
--- a/tests/_convert/snapshots/pypercent_format.py.txt
+++ b/tests/_convert/snapshots/pypercent_format.py.txt
@@ -23,7 +23,9 @@ def _(mo):
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""This is a doc string, but also markdown""")
+ mo.md(r"""
+ This is a doc string, but also markdown
+ """)
return
diff --git a/tests/_convert/snapshots/sql-notebook.py.txt b/tests/_convert/snapshots/sql-notebook.py.txt
index 5b37f069f1..de589726a5 100644
--- a/tests/_convert/snapshots/sql-notebook.py.txt
+++ b/tests/_convert/snapshots/sql-notebook.py.txt
@@ -6,7 +6,9 @@ app = marimo.App(app_title="My Title")
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""# SQL notebook""")
+ mo.md(r"""
+ # SQL notebook
+ """)
return
diff --git a/tests/_convert/snapshots/unsafe-doc-old.py.txt b/tests/_convert/snapshots/unsafe-doc-old.py.txt
index 23fa1c964f..643f17808a 100644
--- a/tests/_convert/snapshots/unsafe-doc-old.py.txt
+++ b/tests/_convert/snapshots/unsafe-doc-old.py.txt
@@ -61,7 +61,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""<!-- Hidden code block -->""")
+ mo.md(r"""
+ <!-- Hidden code block -->
+ """)
return
@@ -73,7 +75,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""<!-- Empty code block -->""")
+ mo.md(r"""
+ <!-- Empty code block -->
+ """)
return
@@ -84,7 +88,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""<!-- Improperly nested code block -->""")
+ mo.md(r"""
+ <!-- Improperly nested code block -->
+ """)
return
diff --git a/tests/_convert/snapshots/unsafe-doc.py.txt b/tests/_convert/snapshots/unsafe-doc.py.txt
index 633638f9ac..b5e7f8460a 100644
--- a/tests/_convert/snapshots/unsafe-doc.py.txt
+++ b/tests/_convert/snapshots/unsafe-doc.py.txt
@@ -61,7 +61,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""<!-- Hidden code block -->""")
+ mo.md(r"""
+ <!-- Hidden code block -->
+ """)
return
@@ -73,7 +75,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""<!-- Empty code block -->""")
+ mo.md(r"""
+ <!-- Empty code block -->
+ """)
return
@@ -84,7 +88,9 @@ def _():
@app.cell(hide_code=True)
def _(mo):
- mo.md(r"""<!-- Improperly nested code block -->""")
+ mo.md(r"""
+ <!-- Improperly nested code block -->
+ """)
return
diff --git a/tests/_convert/test_convert_utils.py b/tests/_convert/test_convert_utils.py
index c26e154122..ea13347bbf 100644
--- a/tests/_convert/test_convert_utils.py
+++ b/tests/_convert/test_convert_utils.py
@@ -22,7 +22,10 @@ Here are some quotes: \"\"\"
assert utils.markdown_to_marimo(markdown) == expected
markdown = r"This has a backslash: \\"
- expected = 'mo.md(r"""This has a backslash: \\\\""")' # noqa: E501
+ expected = '''
+mo.md(r"""
+This has a backslash: \\\\
+""")'''.strip() # noqa: E501
assert utils.markdown_to_marimo(markdown) == expected
diff --git a/tests/_lint/snapshots/markdown_dedent_errors.txt b/tests/_lint/snapshots/markdown_dedent_errors.txt
index f61eed81a4..645b22af6c 100644
--- a/tests/_lint/snapshots/markdown_dedent_errors.txt
+++ b/tests/_lint/snapshots/markdown_dedent_errors.txt
@@ -12,6 +12,20 @@ warning[markdown-indentation]: Markdown cell should be dedented for better reada
| ^
25 | # With a comment
+warning[markdown-indentation]: Markdown cell should be dedented for better readability
+ --> tests/_lint/test_files/markdown_dedent.py:35:1
+ 35 | @app.cell
+ 36 | def _(mo):
+ | ^
+ 37 | # With a comment
+
+warning[markdown-indentation]: Markdown cell should be dedented for better readability
+ --> tests/_lint/test_files/markdown_dedent.py:43:1
+ 43 | @app.cell
+ 44 | def _(mo):
+ | ^
+ 45 | # With a comment
+
warning[markdown-indentation]: Markdown cell should be dedented for better readability
--> tests/_lint/test_files/markdown_dedent.py:51:1
51 | @app.cell
diff --git a/tests/_runtime/script_data/script_exception_with_output.py b/tests/_runtime/script_data/script_exception_with_output.py
index 3e5bf40720..37b7f1ec6b 100644
--- a/tests/_runtime/script_data/script_exception_with_output.py
+++ b/tests/_runtime/script_data/script_exception_with_output.py
@@ -1,3 +1,9 @@
+# /// script
+# requires-python = ">=3.13"
+# dependencies = [
+# "marimo",
+# ]
+# ///
import marimo
__generated_with = "0.6.19"
diff --git a/tests/_runtime/test_trace.py b/tests/_runtime/test_trace.py
index ac0d80c3a6..187917a3b3 100644
--- a/tests/_runtime/test_trace.py
+++ b/tests/_runtime/test_trace.py
@@ -77,7 +77,7 @@ class TestScriptTrace:
result = p.stderr.decode()
assert "ZeroDivisionError: division by zero" in result
- assert ('script_exception_with_output.py", line 11') in result
+ assert ('script_exception_with_output.py", line 17') in result
assert "y / x" in result
@staticmethod
@@ -320,5 +320,5 @@ class TestEmbedTrace:
)
assert "ZeroDivisionError: division by zero" in result
- assert (file_path + "&quot;, line 11") in result
+ assert (file_path + "&quot;, line 17") in result
assert "y / x" in result
diff --git a/tests/_save/external_decorators/app.py b/tests/_save/external_decorators/app.py
index 6728f744f2..5c6337e88a 100644
--- a/tests/_save/external_decorators/app.py
+++ b/tests/_save/external_decorators/app.py
@@ -1,3 +1,9 @@
+# /// script
+# requires-python = ">=3.13"
+# dependencies = [
+# "marimo",
+# ]
+# ///
import marimo
__generated_with = "0.14.16"