dexplo / jupyter_to_medium

Python package for publishing Jupyter Notebooks as Medium blogposts
https://dexplo.org/jupyter_to_medium
MIT License
144 stars 13 forks source link

Single gist #48

Closed kefirbandi closed 1 year ago

kefirbandi commented 2 years ago

Hi,

I really like the jupyter_to_medium package, it helped me a lot to create my post. (https://towardsdatascience.com/creating-a-ui-with-ipywidgets-and-autocalc-2ef8ea4cc6c2?source=friends_link&sk=d0077f21d38df0313c0e727a378af415) However, I found that when I had multiple iterations of the post, it was very tedious to remove the gists from the previous run, as I didn't want them to pollute my gist space.

What I ended up doing is to publish all snippets to the same gist but in multiple files. To the reader it looks the same: all cells appear in different code blocks. But it is easier to maintain, e.g. I can simply delete a previous iteration in one go.

In addition I made two other, minor changes:

1, The URL of the gist is stored in the base directory 2, User can set whether the gist is public (default) or secret. (The latter means it can be viewed, but is not discoverable without the url).

I hope you'll like these additions, let me know if you'd like me to change anything.

This is an example of a draft I created, I hope you are able to access it: https://medium.com/@andras.gefferth/test-notebook-0-11fef353b63f

Andras

mjam03 commented 1 year ago

Hey,

So sorry for not getting back to you on this - I kind of dropped the ball with maintaining this repo.

I've just scanned your PR and it looks great! A much better way of doing things - I completely agree with you that having a single gist with multiple parts is cleaner, simpler and easier to maintain when drafting.

I'll pull it down locally and check it all looks good then get it merged in this week and deployed.

Thanks again, Mark

kefirbandi commented 1 year ago

Thank you. Meanwhile, actually, I had to make some other changes (like updating the dependency versions) to make it work. Also added wkhtmltoimage as a third option to create images from table besides chrome and matplotlib. I will have a look and create pull requests so that you can decided if you like them, if my time permits.