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

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!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group