Live data from Hacker News

Show HN: A tool to convert Jupyter notebooks to beautiful blogs

github.com

21–30 of 38 posts

Re: Show HN: A tool to convert Jupyter notebooks to beautiful blogs

#21
post #6

I have never understood why the "In[5]" and "Out[5]" in jupyter have to be so prominent, even in a output like this.

The numbers track the order that the cells were executed in. So, strictly speaking, you need the numbers to be able to reproduce the output of the notebook's author. However, I think it's bad practice and pretty uncommon to publish a notebook where you need to execute the cells out of order. So most of the time the numbers aren't useful.

Re: Show HN: A tool to convert Jupyter notebooks to beautiful blogs

#22
post #6

I have never understood why the "In[5]" and "Out[5]" in jupyter have to be so prominent, even in a output like this.

Agreed. They should be (5) Input: / Output:. Where input and output are on the same level of indentation under (5).

Re: Show HN: A tool to convert Jupyter notebooks to beautiful blogs

#23
post #6

I have never understood why the "In[5]" and "Out[5]" in jupyter have to be so prominent, even in a output like this.

_5 is a magic variable with the value of the output from cell 5. _ refers to the last output. Super handy when working interactively.

Re: Show HN: A tool to convert Jupyter notebooks to beautiful blogs

#24
post #6

I have never understood why the "In[5]" and "Out[5]" in jupyter have to be so prominent, even in a output like this.

The numbers track the order that the cells were executed in. So, strictly speaking, you need the numbers to be able to reproduce the output of the notebook's author. However, I think it's bad practice and pretty uncommon to publish a notebook where you need to execute the cells out of order. So most of the time the numbers aren't useful.

Indeed, and the line numbers are a warning that you might have an order-of-execution bug lurking somewhere.

Re: Show HN: A tool to convert Jupyter notebooks to beautiful blogs

#25
post #6

I have never understood why the "In[5]" and "Out[5]" in jupyter have to be so prominent, even in a output like this.

_5 is a magic variable with the value of the output from cell 5. _ refers to the last output. Super handy when working interactively.

Oh my god. I have used Jupyter notebooks for 7 years and never knew this. I just had to fire one up to verify -- and yep; exactly as described. How amazing! Thank you!

Re: Show HN: A tool to convert Jupyter notebooks to beautiful blogs

#26
Nice. I have been using gitlab CI and a simple Python script to publish my notes (usually in markdown and Jupyter notebooks) to Gitlab pages. You can find the output on http://avilay.gitlab.io/gyan. And if you want to reuse the code you can find it in https://gitlab.com/avilay/gyan/blob/master/publisher/publish.... Will surely check out your stuff.

Re: Show HN: A tool to convert Jupyter notebooks to beautiful blogs

#29
post #26

Nice. I have been using gitlab CI and a simple Python script to publish my notes (usually in markdown and Jupyter notebooks) to Gitlab pages. You can find the output on http://avilay.gitlab.io/gyan . And if you want to reuse the code you can find it in https://gitlab.com/avilay/gyan/blob/master/publisher/publish... . Will surely check out your stuff.

I didn't find it responsive though. Maybe not your goal but the designs are similar. Similarly I think you can import nbconvert instead of just calling from subprocess.

Re: Show HN: A tool to convert Jupyter notebooks to beautiful blogs

#30
post #4

Cool, but I would rather use a better supported static site generator with an ipynb plugin (ie, https://github.com/danielfrg/pelican-ipynb ) than a tool just for notebooks. Especially because this looks like an nbconvert workflow under the hood.

> Especially because this looks like an nbconvert workflow under the hood.

It is, however I convert it to the most basic html and add custom css and js to it. So that I can change it to whatever I want. I don't see any problem with that maybe you could point some out.

I didn't go with pelican(or any static gen) because the build times will be much slow later on as blogs increase [1] as this guy faced. I like to configure a lot of things manually and don't want the burden of static gen if that make sense to you. I just needed a converter.

1. https://nipunbatra.github.io/blog/2017/Jupyter-powered-blog....

Post reply on HN