UPDATE 2020/08/10: I believe there is a more reliable method here. The method below still does work, but I’ve encountered too many problems to continue on using it at the moment…
This really isn’t a standard Python tip, but interesting to those folks running WordPress sites that may want it AND are hitting problems doing so. You can end up embedding a Jupyter notebook out of github directly (sort of) and it looks wonderful – see post below for an example:
There is a great little post here on how to do it:
Ultimately it points to the author of a little plugin here:
https://www.andrewchallis.co.uk/portfolio/php-nbconvert-a-wordpress-plugin-for-jupyter-notebooks/
These instructions will *probably* work for most of you guys, however I host with Nearlyfreespeech.net, whom is a great hosting company but they are very security conscious. If you’re looking for WordPress/Themes/Plugins to auto update – it’s not the spot. Most of my work on the backend is done in SSH, and getting the right permissions/groups/owners on the files and directories for auto updates is not remotely easy and a bit of a waste of time. I run some chron jobs to do that “auto” work for me. Meaning the instructions above do not work for me. Here’s what I did instead…
- Ignored WP Pusher and didn’t install it – it wouldn’t work for me anyway
- Download the .php and .css files from Github
- Create a directory by hand for nbconvert, load those in and activate in WordPress Admin
- Added the short code to my post
- I added the CSS to my additional CSS in the theme anddd it didn’t work… I think the problem is that this code was written 2 years ago and things have changes both with the conversion site and WordPress. It largely looked OK but tables were overflowing instead of scrolling horizontal. Along with that, the text was 9pt and tiny. The additional CSS from the authors site is either being overwritten by the theme or the classes are different. So I played around and added the following CSS to my theme.
/* Fix issue with nbconvert */ .output_wrapper { overflow-x:auto !important; } /* Uncomment if the output wrapper breaks, last ditch attempt... div { overflow-x:auto !important; }*/ .text_cell_render { font-size: 10pt }
I think the problem here is that class names have changed over time. This will probably break in the future and need to be updated, but it looks great now.