red-data-tools/jekyll-jupyter-notebook

python.ipynb.html' not found.

fjp opened this issue · 8 comments

fjp commented

Hi,

thanks for the gem. However, I always get the following error:

Not Found
`/test/python.ipynb.html' not found.
WEBrick/1.4.2 (Ruby/2.5.1/2018-03-29) at localhost:4000

I placed the python.ipynb file inside the same folder as test.md.
Do I need to first export the ipython notebook as html manually?

kou commented

Can you show your repository that reprouces this case and how to reproduce this case with the repository?

fjp commented

Currently I am testing it only local with the minimal mistakes jekyll theme. Later I wanted to host it on github but I guess this won't be possible anyway because the gem is not on the whitelist of github pages.

When I create a new post inside the _posts folder including the python.ipynb file and use the include tag, I get the error message when I want to display the post:

Not Found
`/ipython/python.ipynb.html' not found.
WEBrick/1.4.2 (Ruby/2.5.1/2018-03-29) at localhost:4000

When I save the notebook as python.ipynb.html in a new folder (at the root dir) /ipython everything gets displayed as expected.

A similar thing happens when I want to create a new page inside the _pages folder. Then I get the following message (see also my first post, its the same):

Not Found
`/test/python.ipynb.html' not found.
WEBrick/1.4.2 (Ruby/2.5.1/2018-03-29) at localhost:4000

This can be solved again by adding a folder test.

I am quite new to Jekyll and don't know how to fix this path issue. Has this something to do with how minimal mistakes works?

kou commented

Can you upload your test files and share it?

fjp commented

The post inside _posts/2018-07-11-ipython.md contains:

---
layout: single
title:  "IPython"
date:   2018-07-11 20:10:12 +0200
toc: true
---

## Top page

Here is a Jupyter Notebook:

{% jupyter_notebook python.ipynb %}

### Raw rendered pages

  * [Raw IPython kernel](python-raw.html)

### Other kernels

  * [IRuby kernel](ruby/)

Inside the _posts folder I also have the python.ipynb notebook that contains nothing special except some python code.

The post shows up but displays the the following output/error:

image

I also tried a page test/test.md with the following content:

---
layout: default
title: Top
permalink: /test/
---

## Top page

Here is a Jupyter Notebook:

{% jupyter_notebook python.ipynb %}

### Raw rendered pages

  * [Raw IPython kernel](python-raw.html)

### Other kernels

  * [IRuby kernel](ruby/)

This gives a similar output:

image

kou commented

I close this issue because you don't provide all files. For example, you don't provide python.ipynb, Gemfile and so on.
I hoped that you provide a repository that contains all files to reproduce this case.

https://github.com/red-data-tools/jekyll-jupyter-notebook/tree/master/example will help you.

fjp commented

Sorry for not providing the files. I did not do that because the gem is not working with github pages.
However, I uploaded it anyway. You can see the repo here:
https://github.com/fjp/fjp.github.io

And here is the link where the ipython post is missing because of a build error on github:

The page build failed for the master branch with the following error:

The tag jupyter_notebook on line 5 in _posts/2018-07-11-ipython.md is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error/.

For information on troubleshooting Jekyll see:

https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

When I run this site locally using the following command

Locally I testes with the following command and got the results described above.

DISABLE_WHITELIST=true bundle exec jekyll serve

fjp commented

Thanks for providing the example I will also try to spot the error why I cannot properly display post which include a jupyter notebook locally.

By comparing the example Gemfile you provided with mine, I saw that the line where the gem is included has an additional path (option?). Is this required?
gem "jekyll-jupyter-notebook", path: ".."

kou commented

Thanks. I could reproduce this case.
You can't use this Jekyll plugin with github-pages gem. Because github-pages gem forces to enable "safe" mode. This plugin doesn't work on "safe" mode.