[IPython-dev] Preferred way to customize CSS for something that will be displayed on nbviewer?

Aron Ahmadia aron@ahmadia....
Wed Feb 19 21:58:30 CST 2014


Let's say I've developed a snazzy CSS file and I want it so that an
uploaded notebook being viewed on nbviewer uses my custom CSS.

I've seen this bit of code in the wild[1]:

from IPython.core.display import HTML
def css_styling():
    styles = open("../styles/custom.css", "r").read()
    return HTML(styles)
css_styling()

But this seems a bit awkward, since I'm effectively just piping the CSS
file into the notebook's rendered HTML.  Does nbviewer know to look
anywhere for CSS, or is this the best we have right now?

-A

[1]
http://nbviewer.ipython.org/github/barbagroup/AeroPython/blob/master/lessons/00_Lesson00_QuickPythonIntro.ipynb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20140219/05013ff3/attachment.html 


More information about the IPython-dev mailing list