danielfrg / pelican-jupyter

Pelican plugin for blogging with Jupyter/IPython Notebooks
Apache License 2.0
422 stars 105 forks source link

Processing fails [pelican 3.3.0] #6

Closed michaelaye closed 10 years ago

michaelaye commented 10 years ago

I think I have everything set up as instructed, but I get this error:

$ pelican -s pelicanconf.py
WARNING: Could not process posts/2013/11/test.ipynb
custom_highlighter() got an unexpected keyword argument 'metadata'
Done: Processed 0 articles and 0 pages in 0.22 seconds.

# maye at lunatic in ~/Dropbox/src/blog on git:gh-pages x [23:22:53]

My content folder:

$ ll
total 56
-rw-r--r--  1 maye  staff  17519 Nov 29 22:59 test.ipynb
-rw-r--r--@ 1 maye  staff    182 Nov 29 23:16 test.ipynb-meta
-rw-r--r--@ 1 maye  staff    100 Nov 29 00:45 welcome-all.md.old

# maye at lunatic in ~/Dropbox/src/blog/content/posts/2013/11 on git:gh-pages x [23:19:12]

The content of test.ipynb-meta:

$ cat test.ipynb-meta
Title: Testing Notebook blogging
Slug: testing-notebook-blogging
Date: 2013-11-29
Category: Coding
Tags: notebook
Author: K.-Michael Aye
Summary: Just trying out the notebook plugin

The relevant parts of pelicanconf.py:

MARKUP = ('md', 'ipynb')

PLUGIN_PATH = './plugins'
PLUGINS = ('ipythonnb',)

Here's the output of running pelican with the --debug option:

DEBUG: Adding current directory to system path
DEBUG: Temporarily adding PLUGIN_PATH to system path
DEBUG: Loading plugin `ipythonnb`
DEBUG: Registering plugin `ipythonnb`
DEBUG: Restoring system path
DEBUG: Missing dependencies for asc
DEBUG: template list: [u'!simple/archives.html', u'!simple/article.html', u'!simple/author.html', u'!simple/authors.html', u'!simple/base.html', u'!simple/categories.html', u'!simple/category.html', u'!simple/gosquared.html', u'!simple/index.html', u'!simple/page.html', u'!simple/pagination.html', u'!simple/tag.html', u'!simple/tags.html', u'!simple/translations.html', u'_includes/after_footer.html', u'_includes/analytics.html', u'_includes/article.html', u'_includes/article_infos.html', u'_includes/article_time.html', u'_includes/disqus_script.html', u'_includes/disqus_thread.html', u'_includes/footer.html', u'_includes/github.html', u'_includes/header.html', u'_includes/links.html', u'_includes/navigation.html', u'_includes/pagination.html', u'_includes/piwik.html', u'_includes/sidebar.html', u'_includes/social.html', u'archives.html', u'article.html', u'author.html', u'authors.html', u'base.html', u'categories.html', u'category.html', u'gosquared.html', u'index.html', u'page.html', u'pagination.html', u'tag.html', u'tags.html', u'translations.html']
DEBUG: template list: [u'!simple/archives.html', u'!simple/article.html', u'!simple/author.html', u'!simple/authors.html', u'!simple/base.html', u'!simple/categories.html', u'!simple/category.html', u'!simple/gosquared.html', u'!simple/index.html', u'!simple/page.html', u'!simple/pagination.html', u'!simple/tag.html', u'!simple/tags.html', u'!simple/translations.html', u'_includes/after_footer.html', u'_includes/analytics.html', u'_includes/article.html', u'_includes/article_infos.html', u'_includes/article_time.html', u'_includes/disqus_script.html', u'_includes/disqus_thread.html', u'_includes/footer.html', u'_includes/github.html', u'_includes/header.html', u'_includes/links.html', u'_includes/navigation.html', u'_includes/pagination.html', u'_includes/piwik.html', u'_includes/sidebar.html', u'_includes/social.html', u'archives.html', u'article.html', u'author.html', u'authors.html', u'base.html', u'categories.html', u'category.html', u'gosquared.html', u'index.html', u'page.html', u'pagination.html', u'tag.html', u'tags.html', u'translations.html']
DEBUG: template list: [u'!simple/archives.html', u'!simple/article.html', u'!simple/author.html', u'!simple/authors.html', u'!simple/base.html', u'!simple/categories.html', u'!simple/category.html', u'!simple/gosquared.html', u'!simple/index.html', u'!simple/page.html', u'!simple/pagination.html', u'!simple/tag.html', u'!simple/tags.html', u'!simple/translations.html', u'_includes/after_footer.html', u'_includes/analytics.html', u'_includes/article.html', u'_includes/article_infos.html', u'_includes/article_time.html', u'_includes/disqus_script.html', u'_includes/disqus_thread.html', u'_includes/footer.html', u'_includes/github.html', u'_includes/header.html', u'_includes/links.html', u'_includes/navigation.html', u'_includes/pagination.html', u'_includes/piwik.html', u'_includes/sidebar.html', u'_includes/social.html', u'archives.html', u'article.html', u'author.html', u'authors.html', u'base.html', u'categories.html', u'category.html', u'gosquared.html', u'index.html', u'page.html', u'pagination.html', u'tag.html', u'tags.html', u'translations.html']
DEBUG: read file posts/2013/11/test.ipynb -> Article
DEBUG: signal <blinker.base.NamedSignal object at 0x102182ed0; u'article_generator_preread'>.send(<pelican.generators.ArticlesGenerator object at 0x103888b10>)
WARNING: Could not process posts/2013/11/test.ipynb
custom_highlighter() got an unexpected keyword argument 'metadata'
-> writing /Users/maye/Dropbox/src/blog/output/index.html
-> writing /Users/maye/Dropbox/src/blog/output/tags.html
-> writing /Users/maye/Dropbox/src/blog/output/categories.html
-> writing /Users/maye/Dropbox/src/blog/output/authors.html
-> writing /Users/maye/Dropbox/src/blog/output/archives.html
Done: Processed 0 articles and 0 pages in 0.21 seconds.
danielfrg commented 10 years ago

Try adding a new line at the end on the .ipynb-meta, like this:

Title: Testing Notebook blogging
Slug: testing-notebook-blogging
Date: 2013-11-29
Category: Coding
Tags: notebook
Author: K.-Michael Aye
Summary: Just trying out the notebook plugin
michaelaye commented 10 years ago

Alas, no change:

$ cat test.ipynb-meta
Title: Testing Notebook blogging
Slug: testing-notebook-blogging
Date: 2013-11-29
Category: Coding
Tags: notebook
Author: K.-Michael Aye
Summary: Just trying out the notebook plugin

# maye at lunatic in ~/Dropbox/src/blog/content/posts/2013/11 on git:gh-pages x [11:46:28]
$ pelican
WARNING: Could not process posts/2013/11/test.ipynb
custom_highlighter() got an unexpected keyword argument 'metadata'
Done: Processed 0 articles and 0 pages in 0.21 seconds.

# maye at lunatic in ~/Dropbox/src/blog on git:gh-pages x [11:47:29]
michaelaye commented 10 years ago

This is python 2.7 btw. As you are not testing that, maybe that's how you never met this problem.

danielfrg commented 10 years ago

I just created a virtualenv with python 2.7 and is working fine. I am not able to reproduce the error you are getting.

Do you have the latest version? Try using make (make html) to generate the output, that is what I always use (don't think is going to fix it though).

michaelaye commented 10 years ago

Did you try it with pelican 3.3? Because your readme shows an older version. I have 3.3 as written in the issue title. Oh, and make html did not do anything different for me.

danielfrg commented 10 years ago

Yes, I use 3.3 (haven't updated the readme) this is my pip freeze

(blog27)danielfrg@Daniels-MacBook-Pro.local:blog$ pip freeze
Jinja2==2.7.1
Markdown==2.3.1
MarkupSafe==0.18
Pygments==1.6
Sphinx==1.1.3
Unidecode==0.04.14
blinker==1.3
distribute==0.6.45
docutils==0.11
feedgenerator==1.7
ipython==1.1.0
pelican==3.3
pytz==2013.8
pyzmq==2.2.0.1
six==1.4.1
tornado==3.1.1
wsgiref==0.1.2

Also you might try downloading one of my posts using ipython notebooks and see if that one works: here

michaelaye commented 10 years ago

After I confirmed that it is a setup problem and not a content problem by trying one of your notebooks, I went through all package versions I had and I believe it was feedgenerator that was too old (1.2.1). I have it now working, hooray! Thanks for your help!

jfsantos commented 10 years ago

Hi, I have the same issue that @michaelaye reported, but I'm using the same package versions that @danielfrg has. Processing fails even with @danielfrg example notebooks. Any ideas on what may be causing that?

blahster commented 10 years ago

@jfsantos, same here. Processing fails with @danielfrg examples.

danielfrg commented 10 years ago

Unfortunately I am still unable to reproduce this, and therefor fix it.

I just made a couple of updates to fix IPython 2.0 issues, I don't think i will fix your issues but maybe.

I just did this procedure in a clean box and it worked for me:

  1. Download Anaconda: http://continuum.io/downloads
  2. Download pandoc: http://johnmacfarlane.net/pandoc
  3. Install libraries:
conda create -n blog python=3 pip
source activate blog
conda install ipython-notebook
pip install pelican
pip install markdown
(blog)➜  blog git:(master) ✗ pip freeze
Jinja2==2.7.2
Markdown==2.4
MarkupSafe==0.18
Pygments==1.6
Sphinx==1.2.2
Unidecode==0.04.14
backports.ssl-match-hostname==3.4.0.2
blinker==1.3
docutils==0.11
feedgenerator==1.7
ipython==2.0.0
pelican==3.3
pytz==2014.2
pyzmq==14.1.0
six==1.6.1
tornado==3.2

After that make html worked for me.

Please try the latest plugin code with the latests versions and let me know