19

How can I convert an IPython notebook to HTML for use in a Google Blogger blog?

There is an answer here:

IPython notebook to html for blog post?

and I have read the associated blog from fperez, but -f blogger-html does not seem to be an option with nbconvert anymore (Is that right?).

I can convert my notebook to HTML, but Google doesn't seem to like that. If I use the --template basic option, the headers disappear, and the LaTex rendering of mathematical expressions is lost. Also, Google seems to generate errors when saving/publishing, so I can't save it.

Anyone have any info on the updated process?

Community
  • 1
  • 1
Woody Pride
  • 13,539
  • 9
  • 48
  • 62

2 Answers2

3

You can bypass the nvconvert conversion by using your browsers file->"save (page) as" feature. it would download all associated files. It just catches the IPython Notebook UI at the top as well as the data. So with some simple editing it can be done. But I miss that option as well.

Back2Basics
  • 7,406
  • 2
  • 32
  • 45
  • Hmmm... I follow the gist of what you are saying, but not entirely sure how to implement. I can get the html code in muy text editor by saving as you suggest, but Blogger does not seem to like it. What's the trick? – Woody Pride Nov 18 '13 at 05:07
  • When I paste the entire code into an html reader online it comes out beautifully, but Blogger just doesn't seem to like it. – Woody Pride Nov 18 '13 at 05:17
  • 1
    You could display it with this http://nbviewer.ipython.org/ and link to it from your blog. – Back2Basics Nov 18 '13 at 05:26
  • That is in fact what I ended up doing. Thanks – Woody Pride Mar 12 '14 at 06:09
2

Fernando recently posted a slight update to his post about blogging with the notebook.

Update (May 2014): Please note that these instructions are outdated. while it is still possible (and in fact easier) to blog with the Notebook, the exact process has changed now that IPython has an official conversion framework. However, Blogger isn't the ideal platform for that (though it can be made to work). If you are interested in using the Notebook as a tool for technical blogging, I recommend looking at Jake van der Plas' Pelican support or Damián Avila's support in Nikola.

Update: made full github repo for blog-as-notebooks, and updated instructions on how to more easily configure everything and use the newest nbconvert for a more streamlined workflow.

Maybe those two links can help you figure it out.

Community
  • 1
  • 1
Midnighter
  • 3,771
  • 2
  • 29
  • 43