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.

smoke test: docstring_to_markdown (#3686)

Myles Scolnick79da93a2ee5f
diff --git a/marimo/_smoke_tests/docs/docstrings.py b/marimo/_smoke_tests/docs/docstrings.py
new file mode 100644
index 0000000000..85c5e2edfb
--- /dev/null
+++ b/marimo/_smoke_tests/docs/docstrings.py
@@ -0,0 +1,66 @@
+# /// script
+# requires-python = ">=3.12"
+# dependencies = [
+# "docstring-to-markdown==0.15",
+# "marimo",
+# ]
+# ///
+
+import marimo
+
+__generated_with = "0.10.19"
+app = marimo.App(width="medium")
+
+
+def _():
+ import docstring_to_markdown
+ import marimo as mo
+ from marimo._utils.docs import google_docstring_to_markdown
+ return docstring_to_markdown, google_docstring_to_markdown, mo
+
+
[email protected](hide_code=True)
+def _(mo):
+ mo.md("""This notebook compares `docstring_to_markdown` to our internal `google_docstring_to_markdown`.""")
+ return
+
+
[email protected](hide_code=True)
+def _(mo):
+ elements = {
+ "button": mo.ui.button,
+ "checkbox": mo.ui.checkbox,
+ "dropdown": mo.ui.dropdown,
+ "text": mo.ui.text,
+ "radio": mo.ui.radio,
+ "refs": mo.refs,
+ "defs": mo.defs,
+ "hstack": mo.hstack,
+ "vstack": mo.vstack,
+ }
+ element = mo.ui.dropdown(elements, value="button")
+ element
+ return element, elements
+
+
[email protected](hide_code=True)
+def _(element, mo):
+ mo.accordion({"MD doc": mo.plain_text(element.value.__doc__)})
+ return
+
+
+def _(docstring_to_markdown, element, mo):
+ mo.md(docstring_to_markdown.convert(element.value.__doc__))
+ return
+
+
+def _(element, google_docstring_to_markdown, mo):
+ mo.md(google_docstring_to_markdown(element.value.__doc__))
+ return
+
+
+if __name__ == "__main__":
+ app.run()