[IPython-dev] nbconvert: trouble with the new style sheet

Damián Avila damianavila at gmail.com
Thu Jul 4 12:26:37 EDT 2013


El 04/07/13 13:10, Jacob Vanderplas escribió:
> Hi,
> I've been working on adapting the recently-merged nbconvert refactor 
> to work with my Pelican blogging plugin, and am having a really 
> difficult time.  In particular, the header content produced by the new 
> nbconvert (via CSSHTMLHeaderTransformer) contains a lot of extra stuff 
> compared to the old version.  This is conflicting with the default 
> blog theme, and leading to some results which are not very pretty.
>
> In the old iteration of the notebook plugin, I used about half a dozen 
> regular expression replace statements to modify the stylesheet & 
> content and make it play well with the blog style.  My hope was that 
> the new nbconvert would be flexible enough to obviate the need for 
> this sort of text-mangling; in reality the required text-mangling in 
> the new version is much more extensive.  I've been working at it for 
> several hours, and still don't have a suitable solution that leads to 
> nicely-formatted notebooks within blog posts.
>
> For those of you familiar with the new nbconvert: what is the reason 
> for the changes in the default CSS styles between nbconvert 1 and 2? 
>  Is there a good way to recover the old style sheet within the new 
> codebase?
>
> Thanks,
>    Jake
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

Hi Jake,

As far as I know, the changes in css are derived by the incorporation of 
the less machinery to get the final css.
The changes were done in the general IPython css styling, and nbconvert 
is just reading the new style contained in style.min.css.
Probably Mathias can go deeper in the explanation because he PRed the 
changes involving less.

You can always get the old style sheet from previous versions of 
IPython, make an old_ipython.css file and include it in your head 
instead of the new styling.
This is the way I used to do it in my plugin for Nikola, although I am 
migrating to the new styling very soon.

Hope it helps.

Damián.







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130704/912389aa/attachment.html>


More information about the IPython-dev mailing list