Closed houfu closed 10 months ago
This looks as expected on Google Colab.
Redlines('This is an expariment.', 'This is an experiment', markdown_style=None).output_rich
This does not render properly though.
Redlines('This is an expariment.', 'This is an experiment').output_markdown
This is an <span style='color:red;font-weight:700;text-decoration:line-through;'>expariment.</span><span style='color:green;font-weight:700;'>experiment</span>
Markdown(Redlines('This is an expariment.', 'This is an experiment', markdown_style=None).output_markdown)
Adding the markdown_style=None
did not help either. It looks exactly the same as before.
Woah I wasn't aware that output_rich works in Colab. We should put that down too.
I couldn't reproduce None
not working though. Here's my test colab notebook: https://colab.research.google.com/drive/1RrpeKylF5UjB2X3g6qyXnZyp2to1cLQX?usp=sharing
I don't use Colab often enough, so maybe I am missing something. Maybe your environment is set up differently?
This is what I meant, the code snippet below gives me the following output:
test = Redlines('This is an expariment.', 'This is an experiment')
display(Markdown(test.output_markdown))
OK that's expected because colab disregards any HTML code.
This one works though. Does it work for you @bkowshik ?
Yes, this works for me on Google Colab. Why is markdown_style
taking "none"
(string) instead of None
?
Interesting. My original thought was that "none" was a style, not that it was not a style. The default (iirc) is "red-green", so I don't expect someone to pass None
Docs now suggest what to do for colab: https://houfu.github.io/redlines/redlines/redlines.html#colab
I've added notes on how to get your styling to show in environments such as Streamlit and Github. See #17
Now you can add Colab to this list. The main issue is some environments do not render HTML code found in markdown, and the markdown standard is not consistent in showing deletions and insertions.
Currently, the only way to make it work is to set the
markdown_style
argument in Redlines as "none".TODO: Update the documentation to reflect what we can do for Colab.