Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipython.display Markdown not rendering in voila like it does in jupyter lab #796

Open
afonit opened this issue Jan 6, 2021 · 0 comments

Comments

@afonit
Copy link

afonit commented Jan 6, 2021

This may be also related to: #640

Here is the code to reproduce:

from IPython.display import display, Markdown
import ipywidgets as widgets
from ipywidgets import interact

def explainer(num):
    print("The number guessed it: ", num)
    print("")
    print("The formula to use is: ")
    display(Markdown("$\;\;\;\; \\frac{2x+8}{2}-x$"));
    print(f"Substitute the number in for x, in this case {num}")
    display(Markdown("$\;\;\;\; \\frac{2 \cdot %s +8}{2}-%s$" % (num, num)));#.format(number = num)));
    print("Simplify:")
    display(Markdown("$\;\;\;\; \\frac{%s +8}{2}-%s$" % (num*2, num)));#.format(number = num)));
    print("Simplify:")
    display(Markdown("$\;\;\;\; \\frac{%s}{2}-%s$" % (num*2+8, num)));#.format(number = num)));
    print("Simplify:")
    display(Markdown("$\;\;\;\; %s-%s$" % (int((num*2+8)/2), num)));#.format(number = num)));
    print("Simplify:")
    display(Markdown("$\;\;\;\; %s$" % (int((num*2+8)/2) - num)));#.format(number = num)));
    #print(display(Markdown(r"$\frac{2x+8}{2} - x$")))
    print("The result of the computation is: ", int(qa(num)))
interact(explainer, num=widgets.IntSlider(value=4, min=0, max=100));

On the left you will see the rendering in jupyterlab, on the right is voila:
image

Note: This issue seems to be inconsistent, most of the time It does not render properly - but I have seen it render properly a couple of times. But in the instances where it did render properly on page load - it 100% of the time does not render properly after having dragged the slider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant