5

I was wondering if it was possible to convert a notebook to html without the default css, or at least reduce it. I used

jupyter nb-convert --to html filename.ipynb

This currently generates 11k lines of css, which I think is somewhat excessive.

Frank Vel
  • 1,202
  • 1
  • 13
  • 27
  • The length of the output file is also going to depend on the length of your notebook. Can you be more clear - do you want no CSS at all? If it is "reduced" what styling are you ok losing? – aylr Mar 03 '18 at 21:32
  • @aylr The total length of the output file was 13k lines, so if I could trim off 11k lines of css that would be nice. By reduced I mean that any reduction of the output length is acceptable, regardless of what styling is lost. I'm fine with losing all styling, as long as I can still provide a `custom.css` file. – Frank Vel Mar 04 '18 at 08:41
  • Wow, I've never looked at one of those converted files! There are some interesting design decisions there. They include the entire bootstrap library non-minified, yet reference jquery on a cdn... – aylr Mar 05 '18 at 01:10
  • I can't seem to find a clean way to do this. You'll probably have to manually edit the generated file and drop in your own css - or script that edit. Note there is some chatter about changing to a CDN here: https://github.com/jupyter/nbconvert/issues/752 – aylr Mar 05 '18 at 02:18

0 Answers0