I'm looking to add a new button to ipython notebook with a custom icon.
Starting from this question, I know I can change around the icons of a custom button using custom.js
. However it seems i'm limited to the available icons in fontawesome. Is it possible to get custom button icons?
My understanding is that fontawesome
uses svg
format, and I found this question/answer,
describing the process for fontawesome, however the HTML
that IPython uses is a bit different.
The question remains how can I point my icon.svg
file to be read by IPython notebook
, below is a minimal example in custom.js
to add a button, along with the relevant HTML
produced.
Minimal button example in custom.js:
IPython.toolbar.add_buttons_group([
{
'label': 'Create TOC',
'icon' : 'icon-list',
'callback': function(){
}
}]);
The line 'icon' : 'icon-list',
correlates to one of the many icons fontawesome has here
IPython HTML for the above button:
<div class="btn-group">
<button class="btn" title="Create TOC">
<i class="icon-list"></i>
</button>
</div>
Is there a way to customize an icon in IPython notebook
without having to add it to fontawesome
?