pelican-jupyter icon indicating copy to clipboard operation
pelican-jupyter copied to clipboard

not rendering notebooks every time (when there was no change)?

Open flothesof opened this issue 4 years ago • 2 comments

Hi, I've been using your plugin for quite some time for my blog (source: https://github.com/flothesof/PelicanBlog) which basically consists of .md posts that look like this:

Title: A Phased Array Animation
lang: en
date: 2020-04-22 17:10
comments: true
slug: phased-array-animation
Tags: Waves, Physics, Animations
Category: Python
Image: /images/thumbnail_20200422_PhasedArrayAnimation.png
Summary: Inspired by a recent Twitter post, I recreate a phased array animation using numpy, matplotlib and holoviews.

{% notebook posts/20200422_PhasedArrayAnimation.ipynb cells[:] %}

What I've noticed is that every time I run pelican to build the blog, even when there are no changes to the notebooks themselves, all the notebooks get rebuilt. Since I have around 100 blog posts with notebooks now, this takes around 2 minutes every time I want to regenerate the site.

This is by no means a blocker but it is annoying when I'm trying to adjust the theme and tweak little things.

Therefore, I have two questions:

  • do you see a workaround for my situation that I have missed?
  • would it make sense to implement a caching mechanism to prevent the notebook output to be generated even when there were no changes?

Thank you for your help. Florian

flothesof avatar Apr 23 '20 08:04 flothesof

Yes, I totally get it. I have the same issue and I have learned to live with it tbh :D Its should be possible to implement some kind of caching and I will be happy to accept any PRs. Honestly its probably not much work to do this on the code for the plugin. What so is that I have all the notebooks in one directory and remove them when I need to iterate (not very often).

danielfrg avatar Apr 23 '20 15:04 danielfrg

Thanks for your feedback. Apparently, there is some sort of caching mechanism built-in with Pelican (see https://docs.getpelican.com/en/latest/settings.html#reading-only-modified-content), but I've been unable to make it work on my blog configuration. Do you have any pointers to how I could start investigating a modification of the plugin? Your tip about removing the notebook seems quite useful, thanks!

flothesof avatar Apr 23 '20 17:04 flothesof