Skip to content

Commit ad835cc

Browse files
timsaucerclaude
andcommitted
docs: render DataFrame cell outputs as text, not the HTML widget
myst-nb prefers a cell's `_repr_html_` over its text repr. A datafusion DataFrame's HTML repr is a Jupyter-oriented widget — inline styles plus an injected <script> — that renders at the wrong width in the docs theme. Set nb_mime_priority_overrides so the html builder prefers text/plain. The 35 cells that end in a bare DataFrame now show the same readable ASCII table the old IPython directive produced, with no per-cell `.show()` edits and no dependence on the package-generated HTML staying theme-compatible. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1e5e7b5 commit ad835cc

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

docs/source/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@
7575
nb_execution_timeout = 120
7676
nb_execution_raise_on_error = True
7777

78+
# Prefer the plain-text repr of a cell's last expression over its rich
79+
# `_repr_html_`. A DataFrame's HTML repr is a self-contained widget (inline
80+
# styles + an injected <script>) built for Jupyter; in the docs theme it
81+
# renders at the wrong width. The text repr is the readable table the old
82+
# IPython directive showed and is stable across datafusion versions.
83+
nb_mime_priority_overrides = [("html", "text/plain", 0)]
84+
7885
# Add any paths that contain templates here, relative to this directory.
7986
templates_path = ["_templates"]
8087

0 commit comments

Comments
 (0)