Skip to content

Add interactive doc lookup for data-marimo-doc in cell output#8343

Open
manzt wants to merge 3 commits intomainfrom
push-xtnmvruznuly
Open

Add interactive doc lookup for data-marimo-doc in cell output#8343
manzt wants to merge 3 commits intomainfrom
push-xtnmvruznuly

Conversation

@manzt
Copy link
Collaborator

@manzt manzt commented Feb 17, 2026

Any HTML formatter can now annotate elements with a data-marimo-doc attribute to get hover-to-docs behavior in the Documentation panel:

    <div data-marimo-doc="torch.nn.Linear">
      <span class="nn-t-type">Linear</span> ...
    </div>

When the user hovers over an element carrying this attribute, the frontend fires a doc lookup request through the existing autocomplete system (no new API endpoints). Jedi resolves the qualified name and the result populates the Documentation panel, the same one used for live docs when the cursor is on a symbol in the editor.

The first consumer is the PyTorch nn.Module formatter, where hovering a layer row shows the docstring for that module class.

But the mechanism is generic: any formatter that emits HTML with data-marimo-doc="some.qualified.Name" gets the same behavior for free.

Screen.Recording.2026-02-17.at.1.03.42.PM.mov

@manzt manzt requested a review from Light2Dark as a code owner February 17, 2026 18:04
@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Feb 17, 2026 6:51pm

Request Review

akshayka
akshayka previously approved these changes Feb 17, 2026
Comment on lines 400 to 404
case "close": {
case "close":
BINDING_MANAGER.destroy(modelId);
modelManager.delete(modelId); // aborts the model's signal, clearing listeners
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intentional? Or lint/format?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm this came from running the linter pnpm lint. I thought it would fix linting CI... but that still seems to be failing. I'll revert and figure it out.

Base automatically changed from push-uynvsxvzkrol to main February 17, 2026 18:39
@manzt manzt dismissed akshayka’s stale review February 17, 2026 18:39

The base branch was changed.

Any HTML formatter can now annotate elements with a `data-marimo-doc`
attribute to get hover-to-docs behavior in the Documentation panel:

```html
    <div data-marimo-doc="torch.nn.Linear">
      <span class="nn-t-type">Linear</span> ...
    </div>
```

When the user hovers over an element carrying this attribute, the
frontend fires a doc lookup request through the existing autocomplete
system (no new API endpoints). Jedi resolves the qualified name and the
result populates the Documentation panel, the same one used for live
docs when the cursor is on a symbol in the editor.

The first consumer is the PyTorch `nn.Module` formatter, where hovering
a layer row shows the docstring for that module class. But the mechanism
is generic — any formatter that emits HTML with
`data-marimo-doc="some.qualified.Name"` gets the same behavior for free.
@manzt manzt force-pushed the push-xtnmvruznuly branch from 3f1b527 to 456c1f7 Compare February 17, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants