Closed cosmos72 closed 5 years ago
@cosmos72 thanks this is working great! The display example notebook is looking really cool!
I took this PR for a test drive and everything ran smoothly (implementing the interfaces in within the notebook also worked well!) but one thing I noticed is that defining multiple render implementations results in only one being selected.
For example I would expect the following to display both text.html
and text/latex
:
type H struct {
}
func (h H) HTML() string {
return `<h2 style="color:blue;">Hello again, world!</h2>`
}
func (h H) Latex() string {
return `$Hello again, world!$`
}
H{}
It is up to the frontend to decide which it prefers to display.
True, I did not think about it. Added in a079f39dab6cf77239c38301b6ffc3c5a65a4b58
TODO: keep []xreflect.Type returned by eval(), to preserve interpreted methods