cancel
Showing results for 
Search instead for 
Did you mean: 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

Rendering markdown images hard coded as data image png base64 in notebook

DavidKxx
New Contributor III

Hi all,

For training purposes, I have cloned a repo from John Snow Labs into my Databricks account and am working in the notebook that you can review at https://github.com/JohnSnowLabs/spark-nlp-workshop/blob/master/open-source-nlp/03.0.SparkNLP_Pretrai....

My little problem is with displaying images.  For example, see the diagram immediately above the section heading "SpanBertCoref", that illustrates some concepts on a sentence beginning with "The sun is shining".  In Databricks, the image doesn't render -- I only see the [image.src] placeholder instead.

Looking inside the Markdown code in the image cell, I see a quite a long encoding that I can't quote exactly here, because it breaks this message board interface.  Here's a screenshot:

DavidKxx_0-1700585428705.png

 

 

From sources like https://superuser.com/questions/1199393/is-it-possible-to-directly-embed-an-image-into-a-markdown-do... I gather that this is a known method for hard-coding images into the notebook via the base64 encoding.

Can Databricks notebooks be made to interpret and display cells like this correctly?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

NateAnth
Valued Contributor
Valued Contributor

Try changing the magic command for that cell from %md to %md-sandbox to see if that helps the image to render appropriately.

View solution in original post

2 REPLIES 2

NateAnth
Valued Contributor
Valued Contributor

Try changing the magic command for that cell from %md to %md-sandbox to see if that helps the image to render appropriately.

DavidKxx
New Contributor III

@NateAnth wrote:

Try changing the magic command for that cell from %md to %md-sandbox to see if that helps the image to render appropriately.


Yes, that worked nicely, thanks!

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!