interactive icon indicating copy to clipboard operation
interactive copied to clipboard

Support `.dib` notebook rendering in GitHub

Open bmitc opened this issue 3 years ago • 1 comments
trafficstars

Is your feature request related to a problem? Please describe. When creating .NET Interactive notebooks with the .dib file format, I would like to upload the notebooks to GitHub and/or GitHub Gist to share direct links to or embed in webpages.

Describe the solution you'd like I would like the .dib format to render in the browser just as .ipynb notebooks render. This Gist contains the same content in .dib and .ipynb formats, and only the latter renders.

The major benefit of the render is that Gists can be easily embedded, such as in blogs, and .ipynb notebooks are still rendered when embedded.

Describe alternatives you've considered Convert the .dib format notebooks to the .ipynb format. However, I prefer the .dib format since the raw format is much more concise and readable. I also prefer not having the Python association in my notebook file names. 🙂

A related discussion thread is https://github.com/dotnet/interactive/issues/467, but I thought it would be good having a separate issue tracking this. It isn't clear to me how one gets custom file formats to render on GitHub. From my searching, it appears that GitHub doesn't expose a public method to do this and needs to implement the rendering themselves. Maybe the .NET Interactive team would have to collaborate with the GitHub team on that internally?

The only documents I found were:

  • https://docs.github.com/en/repositories/working-with-files/using-files/working-with-non-code-files
  • https://github.blog/2015-05-07-github-jupyter-notebooks-3/
  • https://blog.jupyter.org/rendering-notebooks-on-github-f7ac8736d686

bmitc avatar Aug 20 '22 05:08 bmitc

@Krzysztof-Cieslak do you know who we can ping about that?

xperiandri avatar Aug 30 '22 22:08 xperiandri

@scottarbeit maybe you can help?

xperiandri avatar Feb 27 '23 22:02 xperiandri

@xperiandri Trying to find the right team internally to comment. 99% sure GitHub has to write that code, can't be done by a third-party.

ScottArbeit avatar Feb 27 '23 22:02 ScottArbeit

Just so you know, "no current plans" to implement this right now.

ScottArbeit avatar Feb 28 '23 03:02 ScottArbeit

Just so you know, "no current plans" to implement this right now.

Any particular reasons? Seems rather useful.

dystopiandev avatar Feb 28 '23 14:02 dystopiandev

Like every other dev team: it's just about prioritization. No objections to the feature itself, but the team that would do it has a lot of higher-impact work on its plate.

ScottArbeit avatar Feb 28 '23 19:02 ScottArbeit

OK, but at least having some response, setting tags, telling the community how can they speed up the process would be nice...

xperiandri avatar Feb 28 '23 19:02 xperiandri

I've marked it as external because it's not something that the .NET Interactive team would be able to implement ourselves.

jonsequitur avatar Feb 28 '23 22:02 jonsequitur

Then we need to open an issue somewhere else, right? Where then?

xperiandri avatar Mar 01 '23 16:03 xperiandri

That is really too bad. Is there any way that GitHub opens up the possibility for someone to help implement it for them?

I consider this a major feature for Microsoft's Polyglot Notebooks. *.ipynb notebooks are ill-suited for source-code control, but they get rendered in GitHub. *.dib notebooks are great for source-code control but do not render in GitHub. It's often better to just throw out caring about how much *.ipynb notebooks pollute source-code control since the feature of being rendered in GitHub is fantastic for linking others to a notebook.

bmitc avatar Mar 13 '23 03:03 bmitc

If diffing .ipynb files is a pain point, have you tried launching PRs in github.dev? It has a very nice .ipynb diff viewer. You can launch this from a PR by pressing ..

image

jonsequitur avatar Mar 14 '23 17:03 jonsequitur