cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform 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
Contributor

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
Databricks Employee
Databricks Employee

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
Databricks Employee
Databricks Employee

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


@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 Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now