anywidget icon indicating copy to clipboard operation
anywidget copied to clipboard

[Suggestion] Provide magics for authoring JS/CSS in separate cells (with better syntax highlighting/etc)?

Open fperez opened this issue 10 months ago • 2 comments

Thanks folks for the great project! This seems like a wonderful advance for the Jupyter widgets ecosystem, I only discovered it recently.

I had one small suggestion - I'm not very fond of the workflow of bundling JS/CSS inside strings when authoring classes, as in general writing code inside strings loses syntax highlighting, natural indentation, etc.

I wonder if you'd consider providing a couple of magics that could allow for a workflow such as:

image

In this (mock-up) example I used globally named variables (cw_esm, cw_css) that would be injected into the namespace, but they could also be cached somewhere else, that's a later design decision.

Anyhow, just an idea - I'll play more with the library regardless, thanks again for your contribution to the Jupyter ecosystem!

fperez avatar Mar 25 '24 19:03 fperez