jupyter_to_medium icon indicating copy to clipboard operation
jupyter_to_medium copied to clipboard

syntax highlightning

Open austinmw opened this issue 2 years ago • 3 comments

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.

austinmw avatar Jan 30 '23 18:01 austinmw

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 avatar Apr 01 '23 13:04 mjam03

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 avatar Apr 01 '23 13:04 mjam03

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

mjam03 avatar Apr 01 '23 14:04 mjam03