feat: _display_ protocol
If an object implements _display_() -> Any, we render it using marimo's built-in renderer applied to obj._display_().
Example:
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| marimo-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 19, 2024 10:12pm |
| marimo-storybook | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 19, 2024 10:12pm |
Is this a documented protocol? Should we include it in our documentation and write a test
May revisit later ...
I found a good reason for this. These are equivalent, so I don't think it is worth the syntactic sugar, but having _display_ could benefit libraries that don't/can't depend on marimo
def _display_():
return obj
def _mime_():
return ("text/html", mo.as_html(obj))
Docs?
Yea needs docs and tests. Will finish this up later this week
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.9.21-dev8