gatsby-remark-embed-gist icon indicating copy to clipboard operation
gatsby-remark-embed-gist copied to clipboard

Embed .ipynb gist on gatsby-mdx page

Open sammatuba opened this issue 6 years ago • 4 comments

Hi. Thank you for the plugin.

I tried embedding .ipynb gists in a mdx page to no success. This is most probably a feature request..

sammatuba avatar Jul 04 '19 09:07 sammatuba

Hi @sammatuba take a look at #12 , does this help?

weirdpattern avatar Jul 04 '19 11:07 weirdpattern

Hello @weirdpattern. Yes, in fact I came across that issue as well and I followed your recommendation: “Add "gatsby-remark-embed-gist/gatsby-ssr` to your list of plugins outside the gatsby-mdx configuration”

It worked beautifully for my gist .py file. However, .ipynb gist file (it’s in .json as raw) is not being rendered as expected. I suppose it’s because it has a specific structure and does not convert exactly to the same html structure you have in the plugin.

these are my gists for example:

this works perfectly with the plugin: https://gist.github.com/sammatuba/70269c2b5268a83344f5de609ea9b3cc

but this doesn't: https://gist.github.com/sammatuba/effedf57b8c2bf0d3249a221af420a89

sammatuba avatar Jul 04 '19 12:07 sammatuba

Ah I see, thanks for the detailed explanation... The plug-in parses the content of the gist as HTML and then does some post-processing to add the highlighting... I will have to look into to give you a better answer...

I'm going to try my best to get to this as soon as I can.

weirdpattern avatar Jul 04 '19 12:07 weirdpattern

I haven't had a chance to look at this... but I promise I will get to this soon...

weirdpattern avatar Jul 22 '19 03:07 weirdpattern