Add interactive doc lookup for data-marimo-doc in cell output#8343
Open
Add interactive doc lookup for data-marimo-doc in cell output#8343
data-marimo-doc in cell output#8343Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
f2f7650 to
9959a6d
Compare
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; | ||
| } |
Contributor
There was a problem hiding this comment.
Was this intentional? Or lint/format?
Collaborator
Author
There was a problem hiding this comment.
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.
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.
3f1b527 to
456c1f7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Any HTML formatter can now annotate elements with a
data-marimo-docattribute to get hover-to-docs behavior in the Documentation panel: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.Moduleformatter, 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