Hacker News new | ask | show | jobs
by d4rkp4ttern 113 days ago
Related, I often work with markdown docs (usually created via CLI agents like Claude Code) and need to collaborate with others in google docs, which is extremely markdown-unfriendly[1], so I built small quality-of-life CLI tools to convert Gdocs -> md and vice versa, called gdoc2md and md2gdoc:

https://pchalasani.github.io/claude-code-tools/integrations/...

They handle embedded images in both directions. There are similar gsheet2csv and csv2gsheet tools in the same repo.

Similar to the posted tool, there is a first time set up involving creating an app, that is documented above.

[1] in the sense there are multiple annoying clicks/steps to get a markdown doc to look good in Gdocs. You'd know the pain if you've tried it.

2 comments

Paste from markdown (Chrome only) works _really_ well for me. What are the extra steps you’re running into?
After reading a comment here about how google docs had awesome markdown handling (I didn't know it supported it at all) I tried it out and it was bad to the extent that I don't think I'll use it again. I can't remember everything, but for instance it kept the syntactic newlines that should be swallowed during rich text conversion and IIRC it had issues with code too.

And then you have to edit it thereafter with their WYSIWYG editor. I was hoping there was an actual "markdown mode" where I could avoid getting into wars about whether this bullet point is in a new list or part of the previous list, etc.

IIRC there's no way to get markdown back out either, once you've realized you made the wrong choice.

Interesting, in my Arc browser, I just tried File -> open -> upload -> blah.md and it does seem to render fine. This exact thing did not work a few weeks ago, meaning the various header markers etc showed up as raw "##" etc, and I had to further select something like "open as new doc" to finally make it look good.
Right click > "Paste from Markdown" instead of just straight up pasting in
Images wouldn't work though, right? I'd be amazed if that worked. My CLI tools handle those.
Obsidian has become almost an operating system for working with markdown. Its Live View / Edit mode is excellent (WYSIWYG) and its ability to accept pasted content and handle it appropriately is good and getting better. Its plugin/extension ecosystem is robust (and has a low barrier to entry), and now that it has a CLI I expect to see an acceleration of clever workflows and integrations.

No affiliation, just a very happy ~early adopter and daily user.

BUT the main supported sync module is cloud only they wont let you self host for free which is really shitty and lame.
I’m intrigued by their recent CLI release as well. I’ll have to check out the markdown edit support too, thanks
interesting we have a very similar internal flow - we like working in markdown but our customers want to leave feedback in Google docs, so we also have an md -> gdoc tool. We don't do the reverse as we ask them to only leave comments/suggested changes and we apply those directly to the markdown and re-export.

I ran into similar issues as you for the image handling, and the work around I use is to use pandoc to convert to docx as a first step and then import that as a Google Doc using the API, as Google Docs seems to handle docx much better than markdown from what I've seen.