How does one add a binder badge to a document so it is visible as an image?

221 Views Asked by At

mybinder.org allows interactive notebooks to be created from repositories. One can create a badge which acts as a link to launch the interactive notebook using mybinder. This badge image is visible in the readme file of the repository, but how can it be viewed as such in a word document and therefore in a publication?

1

There are 1 best solutions below

0
On

If you look at the text of the README, you'll see the image is being served from https://static.mybinder.org/badge_logo.svg. If you go there and right-click near the bottom of the badge, and select Save As..., you can download the .svg to your computer. On your computer open it and use your favorite vector graphics editing program to open it and export it as an image.
Other image editing software may help you as well. Opening .svg in Photoshop autotmatically rasterizes it to an image.

By the way, you can make custom badges that look like similar variations here.

Also the badges are just clickable hyperlinks of URLs that point the MyBinder system at a repository or archive. For example, the launch badge at https://github.com/fomightez/3Dscatter_plot-binder, is just a hyperlink that triggers opening the following link:

https://mybinder.org/v2/gh/fomightez/3Dscatter_plot-binder/master?filepath=index.ipynb

You can just copy and paste the URL into your browser address bar and it does the same thing as clicking a launch badge.
It is that launch URL that you'd want to include in your publication. Especially if you have any concern about reviewers or users being able to click on it after editing.
I, myself, feel it is best to also point people at the repository or archive that has the launch badge on it, because if the build fails down the road in a few months, it may not be readily apparent for most users what to do if the launch fails. Sometimes people unfamiliar with how the badges work aren't able to easily determine the related repository or archive from the launch URL. If you point people at the repository or archive directly, the code is still viewable and then can be used if the appropriate environment can be made without needing the Binder-backing system.