al-folio
al-folio copied to clipboard
Support for jupyter notebooks in the posts/pages
Hi @alshedivat,
Thanks a lot for this amazing project. I am in the process of migrating my website from hugo to al-folio. Since I have some blogposts written in jupyter notebooks, this functionality would really be helpful. Any update on this feature?
Thanks a lot in advance for your attention.
Best, Pietro
Me too...This could be a very useful enhancement!
a good external solution (that can be built within GitHub workflow ) I have seen is this, Hope it is useful.
@alshedivat I managed to implement this and I am willing to do a PR, but I have two main issues:
1 - I used the jekyll-jupyter-notebook you recommended here, but I currently can't test it in a docker environment. I installed everything in my machine (jupyter notebook) and then tested it only locally. What is the best way for me to test it with docker before submitting a PR, that doesn't involve installing docker locally?
2 - when the post can't find the converted jupyter notebook (the plugin calls the jupyter
command to convert the notebook to an html), it displays inside the 404.html page, which ends up redirecting and loading the main page inside again. How can I check if the file exists before attempting to display it? Both the ipynb and converted html file are not displayed in the site.static_files
variable.
As I wrote in issue #1405, this issue may be able to be fixed by using Quarto instead of Distill. Quarto seems to natively support posts and pages written in Jupyter notebooks. Simultaneously, Quarto is inspired by the Distill format.
Let me know what you all think!
@george-gca, thanks for taking a stab at implementing jupyter notebook rendering. do you have a branch / PR with the changes, would love to take a look to better understand the issues in the docker env and page not found.
@gil2rok, Quarto looks interesting. if I understand correctly (according to this tutorial), this would require installing quarto + running quarto render
command on .ipynb
file to produce html output? unless there's an existing jekyll plugin for Quarto, this would require writing our own plugin to be able to execute quarto render
at build time + embed or convert Quarto-generated html into a blog post.
@alshedivat sure, take a look at jupyter-notebook branch on my repo. You need to have jupyter
installed in your current python env. What I did was to create a virtualenv, installed jupyter
in it, then activated this virtualenv before running bundle exec jekyll serve --lsi
. The plugin takes care of converting the notebook to html.
@gil2rok I'll take the discussion about Quarto to the related issue. Thanks for pointing this out.
I just wanted to encourage this effort. I would love to have this functionality as well. Thanks for a nice project.
I just managed to handle the file not found problem, but can't test it with docker environment. I also don't know if I just need to add jupyter notebook to Dockerfile
, or do anything else to make sure it will run smooth on GitHub actions. @alshedivat can you take a look at it?