ipywidgets
ipywidgets copied to clipboard
Hoist typesetting to widget manager interface?
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?toIWidgetManagerand 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
- prefer the manager's typesetter, fall back to the
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 this should be fixed by your work in #3847 . Good to close this issue?
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.