Open metaboulie opened 4 days ago
It looks like this a mkdocs plugin.
It may be worth looking at their API for consistency, which you tag the location with a comment: # (1)!
and # (2)!
https://github.com/Textualize/textual/blob/86fc1054e80e930b2069a7f18c4cdef17afceb9d/docs/examples/guide/widgets/counter02.py#L10
and then reference it later:
1. Associates presses of ++up++ or ++k++ with the `change_count` action, passing `1` as the argument to increment the count. The final argument ("Increment") is a user-facing label displayed in the footer when this binding is active.
2. Called when the binding is triggered. Take care to add the `action_` prefix to the method name.
I wonder if it would make more sense to follow this, which would be a list for tooltips
instead of a dictionary, and all the identifiers are 1,2,3 indexed.
As far as implementation, this should be possible with a Codemirror decoration plugin, and likely a MatchDecorator
Description
Description
A new feature to
marimo.ui.code_editor
to enhance interactivity and usability. This feature would allow users to insert placeholders for identifiers, display tooltips for them, and interact with these identifiers directly within the editor.Proposed API Changes
New Parameter:
tooltips
dict
{{identifier}}
), and values are the corresponding tooltips (strings or rich content).Enhanced Behavior in
value
:{{identifier}}
, can be embedded directly in thevalue
.Interactive Feature in Code Editor:
{{identifier}}
in the editor, display a small interactive "+" button next to it.Example Usage
Expected Behavior:
{{operation}}
identifier appears in the editor.{{operation}}
.Use Cases
Additional Notes
Suggested solution
https://github.com/user-attachments/assets/adfa2ee3-fe98-419c-a451-b883511aa324