I have a research content piece, available as an interactive Jupyter Notebook. I'd like to make this notebook available as a blog post, and do the necessary conversions automatically.
I can use command line and programmatic tools like nbconvert to convert the notebook file to static HTML content with exported images first.
What would be the best option to import static HTML with images to Ghost, sourced from the file system or URL, so that I do not need to manually re-edit/place images, as there is a large number of charts as images (>30).
Even better would be if Ghost could import SVGs (better for chart readability), but in a pinch, normal PNG will do.
Or if there is a simple manual way like copy-pasting HTML with images included please let me know.
It seems you can simply export the Jupyter notebook as static HTML with inline images, open this HTML file in your web browser and then copy-paste into Ghost editor. Some minor tune-ups in Jupyter output is required.
Ghost editor will correctly upload inline images.
Ghost does not support some basic HTML formatting like nested lists, so might need to rewrite your content after trying with the first import.
First make sure how have some settings correctly set up for
matplotliband other figure backends you use:Then we can render the notebook, either in Jupyter itself or Visual Studio Code by running it. Save the resulting notebook with inline images.
Run
nbconvertto output static HTML:Open
html-export/research.htmlin a web browser. I used Firefox.Create a new blog post in Ghost editor.
Copy-paste all content from the static web page to Ghost editor.