dexplo / jupyter_to_medium

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

syntax highlightning #65

Open austinmw opened 1 year ago

austinmw commented 1 year ago

Hi, since Medium now supports syntax highlighting, would it be possible to add an update so that code blocks are inserted in such a way that they get this highlighting by default? Currently I have to copy/delete/reinsert each code block to get syntax highlighting.

mjam03 commented 1 year ago

Hi,

I haven't seen this yet - I'll look into it in the coming week and get back to you.

If it's quick i'll get it implemented right away, if not then i'll come back with what I find anyway.

Thanks for using the package! Mark

mjam03 commented 1 year ago

Btw - are you using the 'gist' feature?

If not then that likely solves your issue at least for now by creating nicely formatted code blocks using gist - info on how to set up here:

https://github.com/dexplo/jupyter_to_medium#create--save-your-github-pat-only-required-for-gist-integration

mjam03 commented 1 year ago

Just had a quick look - here is the release notes they had:

https://blog.medium.com/code-blocks-with-syntax-highlighting-53343df53c4f

It looks like they don't yet support markdown style language declaration like:

"""``` python"""

If they do that then we can support it by adding that to the code snippets when we upload the articles - otherwise without the medium api being enhanced we can't submit the syntax highlighted codeblocks.

For now, I think your best bet is either to continue to manually copy and paste (smaller number of code blocks) or use the gist feature we have that will automatically create and embed gists in your article.

Mark