return to table of content

Import and Export Markdown in Google Docs

tomeraberbach
28 replies
6h37m

Hey folks, I'm the engineer who implemented the new feature. Just clearing up some confusion.

A lot of you are noticing the preexisting automatic detection feature from 2022 [1], which I also worked on. That's NOT what this newly announced feature is. The new feature supports full import/export, but it's still rolling out so you're likely not seeing it yet!

Hope you like it once it reaches you :)

[1] https://workspaceupdates.googleblog.com/2022/03/compose-with...

andybak
3 replies
2h5m

The main effect of slow rollouts on me is that I never use the feature. It goes like this.

1. There's a service I use sporadically or used to use

2. They announce a new feature that might potentially mean I'll start using it again/more

3. I read the post, log in and realise I don't have access yet

4. I completely forget this ever happened.

Surely all the effort that goes into announcing these things is a bit wasted ?

What happened to the a nice "Labs" switch to opt into stuff that's new and a bit raw?

tomeraberbach
0 replies
22m

I can't speak to the reasoning for announcing before 100% rollout, but I can say that the slow rollout is for safety. That way if there's a severe bug, then we can catch it while it affects a small number of users, instead of all users.

Labs is more for experimental features that needs more beta testing before rolling out to everyone, rather than being the "first stage" of slow rollout.

pradn
0 replies
1h34m

It is a bit odd how they do it in Docs. In Cloud, announcements happen when the feature has already fully rolled out. Note, this is separate from region expansion, which might be delayed for some heavy-weight features (like new categories of VMs requiring special hardware.)

dpkirchner
0 replies
18m

At least it's available to paying customers, that's not always the case.

supriyo-biswas
2 replies
4h26m

Is it possible to get this feature in Slides as well?

I often need to prepare technical slides with code in it, and being able to just backtick away into a <code> tag or a <pre> block would be a godsend.

sphars
0 replies
45m

Not an answer to your question because this isn't integrated with Slides, but Slidev[0] can be used for creating slidedecks in Markdown

[0]: https://github.com/slidevjs/slidev

tomeraberbach
1 replies
4h48m

Yes, it will be supported by this API! I actually wasn't aware of this documentation page. I'll make sure it gets updated. Thanks for flagging

scrollaway
0 replies
3h55m

Oh that’s great. Does that mean Google drive will have good markdown previews now?

hellojebus
2 replies
3h21m

Will the API support uploading conversion of markdown to "application/vnd.openxmlformats-officedocument.wordprocessingml.document"? I process thousands of documents each month -- often have to parse from HTML to Markdown to Docx then finally upload and convert to Google Doc format.

tomeraberbach
0 replies
3h6m

It will support importing Markdown as a Google Doc.

I won't support directly importing Markdown as DOCX. For that you could convert from Markdown to Docs to DOCX though.

scrollaway
0 replies
1h17m

Check out Pandoc.

zikani_03
1 replies
20m

Is this also available from the googlecloud APIs libraries? Would be neat to be able to create a Google Doc from markdown content, it's something we were going to look into for one of the things we are building.

tomeraberbach
0 replies
18m

This will be supported by the Drive APIs

chrisfinazzo
1 replies
3h25m

I would have expected this to export CommonMark, but it seems like it's not quite up to that yet. Is that on the board for a future release?

This isn't to say I prefer CM -- because Markdown came into being from Gruber's script. In a literal sense, "Markdown" is defined as whatever `markdown.pl` is, warts and all -- however, contact with the outside world forced things to move in a direction that is (so to speak) more organized that what John originally wrote.

tomeraberbach
0 replies
3h8m

The export part of the feature does support everything that CommonMark does! Curious what gave you the impression that it doesn't?

_boffin_
1 replies
3h57m

Question: when coming up with tests (whatever level they might be) before you submit your code, what’s your thought process about what tests to include? What edge cases to handle? What to not test? Is there much disagreement about what to test?

tomeraberbach
0 replies
3h4m

We did indeed write A LOT of tests!

I would say there wasn't much disagreement there. I typically started out by writing tests for the simple cases, then I would identify edge cases through actual usage of the feature locally, and write tests for those as well. Also, whenever bugs were found, I would write "regression test cases" for those when fixing.

whycome
0 replies
3h35m

Google keep…

tomgp
0 replies
5h3m

Thank you! This is going to make my life MUCH easier

ted_dunning
0 replies
2h33m

I can't wait.

This will make a huge difference to a lot of my work.

startupsfail
0 replies
1h59m

Would appreciate support for comments, with CriticMarkup or something.

sbergot
0 replies
5h21m

Thank you for making that! I was using a plugin to export to markdown but it wasn't ideal.

sandbx
0 replies
4h49m

I would like to be able to open and edit .md files in Google Docs on desktop and mobile like how Google Docs supports opening .docx files

remoquete
0 replies
6h12m

Such a huge quality of life improvement for technical writers who rely on Gsuite collaboration features while editing Markdown docs. Thank you!

jcastro
0 replies
5h29m

This is going to save me so much time, thank you for this!

RandomWorker
0 replies
4h21m

Thanks for doing this! It’s amazing feature to use docs to compose and paste to my Hugo blog. Very good workflow

Freak_NL
14 replies
12h3m

No support for code blocks still:

    ```java
    String x = "xxx";
    ```
No quoting:

    The docs for `libfloof` state:

    > The floof is 4 bytes long, at most.
And when I type `code` with backticks at the start of a line, the word 'code' is formatted as code as expected, but auto-correct automatically capitalises it to 'Code' — which should never be done with code fragments.

So this is basically just headings, italics, bold, and links?

It's really annoying when you need to share technical documentation with lots of code and code-like content with people and they've started doing the spec in Google Drive. Just give me working Markdown.

timClicks
5 replies
8h8m

To add a code block, type @ and scroll down to "Code Block <>". It's still very limited, with syntax highlighting limited to C/C++, Java, JavaSript, Python.

crazygringo
4 replies
5h37m

Is that available only in certain paid versions of Google Workspace, or has it not rolled out to everyone?

When I type @ there's no code block option. I get People, Smart Chips, and then in "Building Blocks" I get five items from "Meeting Notes" to "Project Assets". If I click the arrow to expand to the full list of building blocks, it only adds a sixth item "Launch Content Tracker" and the rest is blank space.

crazygringo
0 replies
5h16m

Ah thank you. Too bad.

Funny that they paywalled that feature, while tools like Colab are free.

Generally, Google has made code-related and academia-related tools freely available. Oh well.

tomeraberbach
0 replies
1h2m

Code blocks are a paid feature, but the Markdown import/export feature is not paid. It's just still rolling out

judge2020
0 replies
5h33m

The author of the feature is another top-level comment and said it's still being rolled out over time, so that's probably why.

ggm
4 replies
11h58m

We just have to iterate in the "markdown support feedback/help" pulldown I guess. because without ```code``` it's not useful.

Looking at you HN... (ok at least we have 2 indents codeblock)

hnarn
3 replies
10h22m

What would ``` add that you can't already do with two indents?

Beyond that, I think support for ```sh type highlighting would be awful, one of the best things about HN is how clean it is, I'd hate to see syntax highlighting or pictures or whatever when scrolling.

promiseofbeans
1 replies
10h10m

It would let you paste a lot of existing markdown into google docs

Freak_NL
0 replies
10h5m

They meant here on HackerNews. The only thing I really miss sometimes is a way to quote without resorting to indented code blocks.

Just a tiny hint that any paragraph like this starting with a greater-than sign is a quote.
codetrotter
0 replies
9h9m

What would ``` add that you can't already do with two indents?

It would let me add those fences before and after the code I’m pasting instead of having to go and add spaces in front of every pasted line. On mobile adding the spaces after pasting is a bit fiddly. Then again, maybe it is a feature because it discourages pasting too many lines of code in many cases.

underdeserver
0 replies
7h18m

Worked for me by typing ```<enter>

It opens a block and you can select Java. (There's only a relatively small number of syntaxes supported, but still.)

stevemk14ebr
0 replies
3h35m

This is supported, but it's probably not rolled out to you yet. And once it is rolled out, you need to turn it on yourself. See the blog the developer linked to in a comment.

akersten
0 replies
4h2m

Also when I close a single line code with `, the formatting stays as if I'm writing more code. It should reset to whatever formatting was before the opening `

bomewish
10 replies
12h30m

If this is implemented properly it’ll be a game changer for collaboration on papers. Means one can write a paper with colleagues in markdown and then easily knit with pandoc/quarto. Cheaper than overleaf etc.

bt1a
4 replies
11h33m

Why not a markdown doc + git with each colleague using their own text editor/IDE of choice?

KeplerBoy
2 replies
11h23m

Because not everyone is interested in setting up a Pandoc/Latex toolchain. Overleaf almost solved this problem but they don't support Pandoc as a frontend and want money unless you self-host.

prmoustache
1 replies
7h5m

You don't need pandoc and even less a latex(WTF does it have to do with md???) toolchain to work with markdown documents.

KeplerBoy
0 replies
3h45m

Sorry, I was talking about scientific writing, where you have to be able to produce PDF artefacts.

Writing in markdown and converting to .tex is actually a quite popular way of doing that these days.

crazygringo
0 replies
5h29m

Because in my experience, the value of collaboration tools isn't versioning -- going back to an older version rarely happens.

It's the suggested edits combined with comments sidebar right there in the document, where you can have whole back-and-forth asynchronous discussions.

There's no obvious/easy way to have comment threads in markdown or in git.

And while you could, in theory, implement suggested edits as commits on a separate branch waiting to be merged in, the workflow for that would be pretty horrible -- are you going to create a separate branch and commit for every single edit? Since small edits are generally individually accepted, rejected, or further modified.

Symbiote
2 replies
8h33m

You can already get most of the way there, as Pandoc supports reading the ODT or DOCX export from Google Docs reasonably well.

I have this in my shell history:

  pandoc --from=docx --to=asciidoc --wrap=none --atx-headers --extract-media=img doc.docx > doc.adoc

chrisfinazzo
1 replies
3h32m

Stick downdoc on the end of that pipeline and you're done -- unless you prefer working in AsciiDoc, I guess. Not my thing, but you do you...

https://github.com/opendevise/downdoc

Symbiote
0 replies
26m

Asciidoctor has been much better received by my colleagues, primarily for the built-in support of a few technical writing features — admonitions, non-trivial tables, crossreferences, etc.

protortyp
0 replies
4h38m

I recently used Typst and their own collab solution for a paper we worked on. While some features are still lacking it was a pretty good experience overall.

gouggoug
0 replies
12h18m

I'll add that writing a paper might be better handled by a more feature-full format like Asciidoc.

tekknolagi
3 replies
13h5m

I thought copy as MD existed years ago and then went to look for it recently and it was gone. Now it's back. Am I losing it?

tekknolagi
0 replies
6h14m

I don't think so... It was part of the download menu for me

stevemk14ebr
0 replies
3h38m

There was partial markdown support (and still is) in gDocs today. AFAIK copy as MD was never supported. But this new feature is full round tripping into and out of gDocs as native markdown.

orliesaurus
3 replies
8h39m

I guess most users of Google Docs have no use for this, especially the download as markdown. I wonder why they decided to add this feature for the tech crowd so late in the lifecycle of the product, feels almost like an Summer '24 intern project?

vitus
0 replies
7h58m

Agreed; given the timing, an intern project seems plausible. (It feels a bit more ambitious than a typical intern project though, and I'm not sure how many of those end up quite so user-facing.)

I can imagine one internal use case.

At Google, we use Google Docs heavily for design docs. After the system has been built, it's not uncommon to link to the design doc as supplementary reading material. But the design doc isn't intended to co-evolve with the system; at some point, we migrate the design details to our internal documentation pages (g3doc [0]), which serves version-controlled markdown files and often has a much lower barrier to entry.

Even though Google Docs is ostensibly collaborative, design docs are often used as a snapshot of an individual's engineering maturity as justification during performance evaluation and promotion, and so it's not typical for them to be updated substantially, years after the initial implementation is complete.

[0] We write about it briefly in a case study about "The Google Wiki" at https://abseil.io/resources/swe-book/html/ch10.html

remoquete
0 replies
6h10m

Collaborative editing of Markdown docs in GitHub / GitLab can be a pain. This is a huge game changer for technical writers. Admittedly not the biggest crowd, but hey...

crazygringo
0 replies
5h22m

Speaking as someone with experience in enterprise software, I'd say there's a good chance it's because one or more large corporations were ready to migrate from MS Office to Google Workspace but that not having Markdown import/export would be a deal-breaker.

A lot of times when you wonder, "why did they add that feature?", that's why. A single large potential customer absolutely needed it because of whatever critical internal business processes they happen to have.

It's a major difference from software sold to consumers, where the aggregate consumer demand for a feature is generally more obvious/intuitive/explainable.

dazzaji
2 replies
9h25m

For Google Docs like real time collab on native markdown, I like and use daily:

* https://hackmd.io

and

* https://stash.new

mcbetz
0 replies
7h54m

I used Hackmd in the past to share the draft of my book (1) and liked that people don't need to have an account to comment. Google Docs was no option as no markdown support and account required. The process worked well but I found Hackmd too expensive for just getting feedback. Stash looks promising for this use case.

(1) Written fully in Markdown in Obsidian at this point. I moved to Asciidoc since because of formatting. The early draft is still available on Hackmd though. Details in my bio.

dotancohen
0 replies
8h40m

W Google docs Writer Competitors

CityOfThrowaway
2 replies
12h44m

My guess is that this is strongly motivated by the success of LLMs.

The lack of MD support makes manual IO from Docs to your favorite LLM lossy (or very annoying). Cool that it's fixed.

thallavajhula
0 replies
12h21m

At this point, most major changes could be motivated by LLMs/AI.

staticman2
0 replies
3h43m

They also already have to support Gemini to Google Docs and vice versa so it makes sense they'd have to support Markdown in some fashion on the backend.

worldmerge
1 replies
8h48m

This is really useful! Hope they continue to add features. I don’t like directly writing markdown and would rather use a text editor like Docs or Word.

sheremetyev
0 replies
4h23m

You are not alone :) For Microsoft Word you might find Writage plugin useful (https://www.writage.com) - supports all basic Markdown syntax, tables etc. and recently added support for math formulas.

mikelnrd
1 replies
5h42m

Is there an API to export a Google doc as markdown?

stevemk14ebr
0 replies
3h37m

Yes, and to import. You mess with the mime types when creating a document or exporting and the conversion operation happens. Standard gdocs APIs cover conversion of formats already with doc files as an example.

guytv
1 replies
9h15m

when did google become sooo sloooow implementing trivial features, and then not even shipping a complete set of markdown?!

EE84M3i
0 replies
8h59m

trivial features

Four features were announced:

1. Convert Markdown to Docs content on paste

2. Copy Docs content as Markdown

3. Export a Doc as Markdown (from File > Download)

4. Import Markdown as a Doc (from File > Open or "Open with Google Docs" from Drive)

Which of these do you see as trivial? These all seem quite complex to me with many edge cases , incompatibilities and ambiguities, especially if there's an expectation that you can round trip losslessly.

eskibars
1 replies
10h43m

This would have been very useful at several companies I worked at as a product manager for release blogs.

I always start editing in gdocs because it's so much easier to collaborate on than any blog platform, but then you always need to copy/paste the content once final into the blog and nearly every time, it copies some elements of formatting into the rich HTML editor I don't want (fonts, font sizes, etc) while I do want some things (headings, bold, italics). It's usually easy to import markdown to blogs or trivial to convert it to stripped-down HTML that can be imported. One of the teams I worked on built a simple gdoc script to do this

hu3
0 replies
4h47m

Indeed, very useful to unite markdown with the omnipresence of gdocs.

One tip for pasting without formating, at least in Windows, is CTRL+SHIFT+V.

dalrympm
1 replies
5h19m

I don't see any mention of table support. That will be the first thing I try, I hope it works... if not now, eventually.

stevemk14ebr
0 replies
3h40m

They are supported (source: beta tested it internally). We use this markdown feature for some internal workflows where github flavor markdown syntax is used. We've tested this works and ourselves rely on it as well as some other markdown extensions.

yosito
0 replies
12h13m

I don't really use Google products, so I find this particularly useful for collaborating with people who do. I can do my shit in Markdown, they can do their shit in Google, and we can easily transfer the content back and forth.

xnx
0 replies
8h16m

So close. I have always hoped for an edit in markdown (or limited formatting) mode.

wscott
0 replies
2h7m

So, can we now write a plugin for Obsidian that syncs changes to Google Drive?

sgt
0 replies
11h40m

This is great, the other day I had to export to HTML from Google Docs and then import the HTML into some kind of Markdown generator. The result was mediocre, but usable.

sanjeevmsk
0 replies
7h40m

Moved to self hosted bookstack recently due to this feature missing

red_admiral
0 replies
10h26m

This is a cool feature, even if parts of markdown still need to be implemented (for pedants: commonmark).

Meanwhile, Trello is once again threatening to force everyone onto the new rich-text editor and disable the old markdown one.

neontomo
0 replies
5h29m

markdown is such an elegant markup implementation, i remember using bbcode on online forums which was ok but markdown i use all the time to keep notes and organise my thoughts. when i do consulting i summarise my work in a github gist.

look forward to trying this.

mavsman
0 replies
4h14m

I would imagine that requests for this feature went way up as ChatGPT has popularized.

jfoster
0 replies
9h1m

Interesting announcement. Feels like some of it is just copy-pasted from a PRD. Not necessarily a bad thing (it's clearer than press release style), just the first time I've noticed it in a "bigtech" announcement.

gempir
0 replies
10h32m

Does this just import Markdowns and convert them to Gdoc and then you export it finally. Or can you collaborate on Markdowns in real time?

Could you build a confluence/wiki like system on top of this?

esprehn
0 replies
3h34m

This is a great feature (and probably related to reliance on markdown from all the LLM services). I do wish they'd add SVG import to slides though, that's been a top feature request for like a decade.

d4rkp4ttern
0 replies
7h14m

I like to have AI auto-complete assistance from something like GitHub copilot, so I often compose markdown within PyCharm and then paste to Google docs. There seem to be zillions of “AI-writing” tools out there but I’m shocked that nothing has replaced the smooth functionality of GitHub copilot. Google docs with Gemini is not smooth at all. Tried obsidian plugins but they are janky.

bapetel
0 replies
2h25m

Good ! I use notion and sometimes when i copy a text from notion to docs, i have to format it again. Now i would not do it.

Crier1002
0 replies
9h6m

i hope they'll eventually support Mermaid (https://github.com/mermaid-js/mermaid) for creating diagrams directly within documents. i've been using it a lot for my markdown files and it works amazingly well with LLMs (e.g. asking LLM to generate the diagram representation of something using Mermaidjs)