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.

improvement: support footnotes in markdown (#732)

Myles Scolnick4c573c76f37f
diff --git a/marimo/_output/md.py b/marimo/_output/md.py
index 10c5f8316f..1eeb1280e4 100644
--- a/marimo/_output/md.py
+++ b/marimo/_output/md.py
@@ -25,6 +25,9 @@ extension_configs = {
"disable_indented_code_blocks": True,
"css_class": "codehilite",
},
+ "footnotes": {
+ "UNIQUE_IDS": True,
+ },
}
@@ -49,6 +52,8 @@ def _md(text: str, apply_markdown_class: bool = True) -> Html:
# Table of contents
# This adds ids to the HTML headers
"toc",
+ # Footnotes
+ "footnotes",
],
extension_configs=extension_configs,
).strip()
diff --git a/marimo/_smoke_tests/md_table.py b/marimo/_smoke_tests/md.py
similarity index 52%
rename from marimo/_smoke_tests/md_table.py
rename to marimo/_smoke_tests/md.py
index 87dba0020f..68faf306a9 100644
--- a/marimo/_smoke_tests/md_table.py
+++ b/marimo/_smoke_tests/md.py
@@ -1,7 +1,6 @@
-# Copyright 2024 Marimo. All rights reserved.
import marimo
-__generated_with = "0.1.42"
+__generated_with = "0.2.1"
app = marimo.App()
@@ -11,6 +10,12 @@ def __():
return mo,
+def __(mo):
+ mo.md("# Tables")
+ return
+
+
@app.cell
def __(mo):
mo.md(
@@ -38,5 +43,31 @@ def __(mo):
return
+def __(mo):
+ mo.md("# Footnotes")
+ return
+
+
+def __(mo):
+ mo.md(
+ """
+ Here's a short footnote,[^1] and here's a longer one.[^longnote]
+
+ [^1]: This is a short footnote.
+
+ [^longnote]: This is a longer footnote with paragraphs, and code.
+
+ Indent paragraphs to include them in the footnote.
+
+ `{ my code }` add some code, if you like.
+
+ Add as many paragraphs as you need.
+ """
+ )
+ return
+
+
if __name__ == "__main__":
app.run()