ipywidgets icon indicating copy to clipboard operation
ipywidgets copied to clipboard

Hoist typesetting to widget manager interface?

Open bollwyvl opened this issue 2 years ago • 2 comments

References

  • as noted on
    • #3829
    • #3848
  • potential fix in #3847 (probably still blocked by upstream fixes to font discovery)

Problem

In the absence of window.MathJax.Hub.Queue, fancy description typesetting fails.

Proposed Solution

As this seems like an host application-level concern, moving this to the manager would ensure that applications could provide this capability more robustly.

Some of the following might work:

  • add a typeset? to IWidgetManager and prefer this
  • add typeset(element: HTMLElement, text: string, manager?: IWidgetManager)
    • prefer the manager's typesetter, fall back to the window-level method otherwise to maintain backwards compatibility

Additional context

It would actually be quite nice if these were actually run through text/ipython-gfm typesetting, but this would be a breaking change if folk expected only $ replacement, unless it was opt-in.

bollwyvl avatar Oct 10 '23 17:10 bollwyvl

@bollwyvl this should be fixed by your work in #3847 . Good to close this issue?

ibdafna avatar Feb 20 '24 07:02 ibdafna

No, this hasn't been PRd yet. As it would be an additive feature to the manager interface, I'm not sure if this would be a breaking change... I haven't looked for in-the-wild uses of DescriptionView.typeset.

I think the larger point would be looking at a bunch of places where typeset is used (and some places it probably isn't but should be) and using the host application's markdown renderer so that latex just shakes out of it.

bollwyvl avatar Feb 20 '24 15:02 bollwyvl