jekyll-jupyter-notebook icon indicating copy to clipboard operation
jekyll-jupyter-notebook copied to clipboard

error message: "Liquid Exception: no implicit conversion of nil into String in E:/.../2017-09-03-blog.md"

Open joyride2017 opened this issue 8 years ago • 7 comments

Hi Mr. Sutou,

Thanks for the update. I still got the same error message. Please take a look at my repo at https://github.com/joyride2017/econ. I used the same .md and .ipynb as in your example. I am sure that I have updated jupyter notebook plugin from 0.0.1 to 0.0.2 by commanding "bundle update." After trying to watch my local changes by commanding "bundle exec jekyll serve --baseurl," I got this message:

Configuration file: E:/sandbox/_config.yml Source: E:/sandbox Destination: E:/sandbox/_site Incremental build: disabled. Enable with --incremental Generating... Liquid Exception: no implicit conversion of nil into String in E:/sandbox/_posts/2017-09-03-blog.md jekyll 3.5.2 | Error: no implicit conversion of nil into String

And on my GitHub Pages, I found a relevant error message:

Your site is having problems building: The tag jupyter_notebook on line 6 in _posts/2017-09-03-blog.md is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error/.

Thanks for the help. I am looking forward to your solution.

Best, Joyride2017

joyride2017 avatar Sep 03 '17 08:09 joyride2017

Please show the output of:

> bundle exec jekyll serve --baseurl "" --trace

kou avatar Sep 03 '17 13:09 kou

You can't use this plugin on GitHub Pages because GitHub Pages supports only limited plugins. See also: https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/

kou avatar Sep 03 '17 13:09 kou

Got it. Thanks for the information.

joyride2017 avatar Sep 04 '17 03:09 joyride2017

@joyride2017 @kou,

Coming in late but I can confirm that as of now, this gem does work for Jekyll builds on GitLab Pages.

All one needs to do is the following:

  • Add the line gem "jekyll-jupyter-notebook" to your Gemfile
  • Add the line gems: - jekyll-jupyter-notebook to your _config.yml (put the - jekyll-jupyter-notebook on a line under gems)
  • Run bundle install
  • Create a directory in your website folder called "notebooks" and store your jupyter-notebooks there
  • And add your notebooks to your posts on a GitLab post (example: {% jupyter_notebook /notebooks/python.ipynb %}

Perhaps we could include this in the official documentation? I would be happy to do a brief write-up @kou

~ TheCedarPrince

[UPDATED] - Attempted build deployment on GitLab but it failed. The reason being was that python is not installed alongside the Ruby image of most jekyll builds - therefore, no Jupyter notebook support for nbconvert. :/

TheCedarPrince avatar Jul 08 '18 05:07 TheCedarPrince

Yes, we should update our documentation. Can you work on it?

We can install Python by apt in the Ruby image. :-)

kou avatar Jul 09 '18 01:07 kou

@kou @TheCedarPrince

Hi I have tried the methods listed in both the README as well as the above comment, however I am unable to get the gem to work with my current set up. I'd appreciate any help with the issue that I'm facing.

As a run down of the checks that I've done :

  • The issue is occurring during local testing, not a github-page.
  • I have tested with the example jekyll environment that you've provided, and I have been able to get it up and running, installing all of the necessary python libraries along the way.
  • I've double checked that the jekyll-jupyter-notebook gem was properly installed.
  • Disabled safe mode.
  • I have tried several methods of integration that you've listed in the example :
    • Including the jupyter file in the same directory as the .md file.
    • Calling the jupyter files from a dedicated notebooks files.
    • Wrapping the call with {::nomarkdown} {:/nomarkdown}

It seems that the issue is that the file is not converted via the NbConvertApp, as that message is not appearing in the console when run outside of the example environment.

Does the folder containing the .ipynb have to be declared in the config? I had not seen such a declaration in the example environment.

Here is a link to the commit that I'm tried to incorporate the jupyter gem on : https://github.com/Jongwoo-Shim/al-folio/commit/7495bdcc04ff8c2317af3352224911ef3f61555c

Jongwoo-Shim avatar Sep 29 '20 06:09 Jongwoo-Shim

There are some issues:

  • If you have github-pages in your Gemfile, safe is always true.
  • jekyll-jupyter-notebook doesn't support basedir yet.

It seems that we should implement Jupyter Notebook converter by Ruby and mark jekyll-jupyter-notebook as safe.

I'll add support for basedir later.

kou avatar Sep 30 '20 02:09 kou

We can use GitHub Actions to use GitHub Pages: https://docs.github.com/en/pages/getting-started-with-github-pages/using-custom-workflows-with-github-pages

We can use this plugin with this approach.

kou avatar Apr 07 '24 21:04 kou