Apr 24, 2026 1.1 KB octet-stream v1 python / marimo · 3 code, 2 md
title returns: mo

Markdown Cells

marimo notebooks mix code and markdown cells. markdown cells use mo.md() and render as rich text.

explanation

how it works

  • code cells contain Python and show syntax-highlighted source
  • markdown cells render as formatted text with headings, lists, links
  • cells can return values that other cells depend on
  • the DAG ensures correct execution order
compute returns: data
1data = {"pi": 3.14159, "e": 2.71828, "phi": 1.61803}
2return (data,)
show_results depends on: data
1lines = [f"- **{k}**: {v}" for k, v in data.items()]
2mo.md("## constants\n\n" + "\n".join(lines))
3return ()
code_example
1# this is a plain code cell — no mo.md()
2# it shows as syntax-highlighted Python
3numbers = [x ** 2 for x in range(10)]
4print(f"squares: {numbers}")
5return ()