How to Convert Obsidian Markdown to Medium Blog
Write Notes in Obsidian Using Markdown and Publish Them to Medium.
As a Medium blogger, as well as a heavy markdown user (preferring markdown to a rich text editor), one of my frustrations, is how to easily use the markdown note in the Obsidian to Medium editor. Direct copy and paste don’t work and you have to manually correct the format simply because the Medium editor doesn’t support Markdown language, up to this moment. This article will introduce you to two approaches to this problem.
Approach #1: Using Existing Tools to Convert `markdown` to `html`
Tools like markdown-to-medium-tool are purposed to convert Markdown format to outputs HTML formatted in a way compatible with the Medium editor.
Let me walk you through how to use markdown-to-medium-tool:
1. run it locally:
2. Or go to its hosted website: https://markdown-to-medium.surge.sh/
Simply copy the generated outputs from the right panel into the Medium editor. Then you’re good to go.
For sure, if you happen to be a coder, then it’s never a bad idea to build some better digital solutions in your spare time. And I personally will keep sharing my mini projects.
Approach #2: Using a Plugin Built for Obsidian — ‘Copy as HTML’
Install and enable the community plugin — Copy as HTML
which converts the selected markdown content to HTML and copies it to the clipboard. The huge benefit of using a plugin inside built for Obsidian is allowing us to stay inside Obsidian to help us concentrate on our work.
To start using this plugin, you need to install and enable the community plugin — Copy as HTML
Demo (Copy Obsidian Markdown note into the Medium text editor)
The detailed steps in the demo:
- Select the content you want to copy inside Obsidian note (important! otherwise nothing will be converted to HTML to Medium. Tip: VIM command -
ggVG
copies the whole note content) - Press
cmd+p
to open Command Palette and type command name:Copy as HTML: Copy as HTML command
, now you have the converted HTML copied to the clipboard. - Open the Medium text editor, and press
cmd+p
to paste the HTML into Medium.
Of course, you could always build your Obsidian plugin to solve the same problem or provide a better solution than the existing one(s). But for now, the Copy as HTML
plugin is good enough for our purpose.
One Feature Is Missing From Medium Editor (Not Good Enough)
Although we could see the beautiful code syntax highlighting based on code language inside our Obsidian note, we don’t see the same effect on the Medium blog.
The medium itself doesn’t this feature. Of course, you could embed your code from GitHub Gist into the Medium text editor, but it’s a bit annoying to go through so many steps to make it happen. Let’s leave it as it is now. Maybe it’s not the priority for Medium yet.
Summary
This post has provided two types of approaches — approach #1 is a universal solution that doesn’t target specific applications or platforms, while approach #2 is built specifically for Obsidian users. So you’re better off by using the second approach if you’re working with Obsidian as you can focus your attention within the Obsidian ecosystem. That’s for today. Thanks for reading.
Update on Nov 2022
- The video version of this article
- Medium now supports the Code Block Syntax Highlighting:
You can choose the language from the dropdown menu below:
Appreciate the work from the M- extremelyedium developer team.