Import and Export Markdown in Google Docs
pentagrama | 652 points | 11mon ago | workspaceupdates.googleblog.com
tomeraberbach|11mon ago
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|11mon ago
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|11mon ago
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.
phil294|11mon ago
That doesn't contradict the parent comment though. Engaged users should have an option somewhere to enable it, barely affecting the overall rollout.
sheikheddy|11mon ago
It’s not about gating the new feature behind a flight, but not wanting to push a new build out to the furthest deployment ring before you need to.
m-p-3|11mon ago
I wish we could opt-in to get early access in the slow rollout. That way you get the enthousiastic users to promote the incoming feature and you get some tech savvy people to test it before it reaches out more people.
pradn|11mon ago
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.)
skybrian|11mon ago
Not announcing a feature in a collaborative environment would likely cause a fair bit of confusion when only some people see it.
TeMPOraL|11mon ago
Docs is supposedly a collaborative environment; without collaborative features, you're better off going back to Microsoft Word.
dpkirchner|11mon ago
At least it's available to paying customers, that's not always the case.
remoquete|11mon ago
Such a huge quality of life improvement for technical writers who rely on Gsuite collaboration features while editing Markdown docs. Thank you!
irskep|11mon ago
Is it also supported in the Google Drive export API? It's not in the docs yet at least. https://developers.google.com/drive/api/guides/ref-export-fo...
tomeraberbach|11mon ago
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|11mon ago
Oh that’s great. Does that mean Google drive will have good markdown previews now?
tomeraberbach|11mon ago
No, this feature doesn't affect the preview. We don't convert a Markdown file to a Doc unless a user initiates it
tomeraberbach|11mon ago
Should be updated now
munificent|11mon ago
You are my hero.
I work at Google in open source so I am constantly converting Google Docs to Markdown to put them on GitHub and vice versa. This will save me a lot of effort.
supriyo-biswas|11mon ago
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.
breck|11mon ago
Not sure if you have the patience to use a beta product, but I recently started adding slideshows to Scroll.
This source code: http://hub.scroll.pub/slideshowdemo/index.scroll
Produces this HTML: http://hub.scroll.pub/slideshowdemo/
sphars|11mon ago
Not an answer to your question because this isn't integrated with Slides, but Slidev[0] can be used for creating slidedecks in Markdown
hellojebus|11mon ago
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|11mon ago
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|11mon ago
Check out Pandoc.
ahimthedream|11mon ago
Can I sync MD files to drive through the osx drive integration? Allowing me to work on a local file in MD, but others can view through web
_boffin_|11mon ago
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|11mon ago
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.
sandbx|11mon ago
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
jez|11mon ago
How does it handle images in the imports and exports?
tomeraberbach|11mon ago
Import supports links via upload
Export outputs base64 encoded image URLs. We use Markdown reference links to place the large URLs out of the way of reading at the bottom of the file
vikramaruchamy|11mon ago
When I export Markdown, the image reference is placed like `[image-1][base64-reference]`. However, the reference links should be `[image-1](base64-reference)`. The brackets for the reference should be parentheses, not square.
Any hint on why you have used square brackets?
tomeraberbach|11mon ago
Link _references_ must be enclosed in brackets. Only _inline_ link URLs use parentheses
See https://daringfireball.net/projects/markdown/syntax#link
vikramaruchamy|11mon ago
Thank you for your reply and sorry for my ignorance. I didn't look much about reference links before writing this.
tomeraberbach|11mon ago
No worries! Glad I could send some new knowledge your way :)
zikani_03|11mon ago
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|11mon ago
This will be supported by the Drive APIs
westurner|11mon ago
Thanks!
Google Colab also supports Markdown input cells as "Text" with a preview.
Does this work with Google Sites?
How to create a Google Sites page from a Markdown doc, with MyST Markdown YAML front matter
NotebookLM can generate Python, LaTeX, and Markdown.
How to Markdown and Git diff on a Chromebook without containers or Inspect Element because [...]
How to auto-grade Jupyter Notebooks with Markdown prose, with OtterGrader
How to build a jupyter-book from .rst, MyST Markdown .md, and .ipynb jupyter/nbformat notebooks containing MyST Markdown
chrisfinazzo|11mon ago
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|11mon ago
The export part of the feature does support everything that CommonMark does! Curious what gave you the impression that it doesn't?
chrisfinazzo|11mon ago
Admittedly, I didn't spend more than 5-10 minutes looking through the specs ¯\_(ツ)_/¯
The existence of comments about how certain elements were rendered on export made me think that something was missing when compared with CM.
lewisjoe|11mon ago
Hi, thanks for this amazing work.
Just curious: Google docs supports a lot more than what Markdown has syntaxes for - how do you deal with this when exporting to markdown?
tomeraberbach|11mon ago
We export to the closest available thing (e.g. file chips become links, people chips become mailto links, etc.) or drop the content entirely if there's truly nothing it can be converted to (rare case)
freedomben|11mon ago
I just wanted to say, it took me a while to discover it (it happened by accident), but the preexisting feature from 2022 was a joy to discover! I didn't know you obviously, but I praised the kind anonymous soul out there who did that. I discovered it about 6 months ago, and I use it all the time now. I'm super excited to see it progress!
hereme888|11mon ago
Duuuuuuuuude, I was just thinking a few days ago: how come markdown isn't yet a thing in word editors?
Well, you solved it. Thanks!
themadturk|11mon ago
Just for reference, Writage is a Word (Mac and Windows) add-in that exports and imports Markdown.
chrisbrandow|11mon ago
Any idea how long is this rollout going to be? I still don't have access to it. (not that you're in charge of the rollout pace)
davecahill|11mon ago
The announcement of the new feature (which I don't have just yet) made me realize that the automatic detection feature existed, and I love it. :)
ted_dunning|11mon ago
I can't wait.
This will make a huge difference to a lot of my work.
tomgp|11mon ago
Thank you! This is going to make my life MUCH easier
RandomWorker|11mon ago
Thanks for doing this! It’s amazing feature to use docs to compose and paste to my Hugo blog. Very good workflow
sbergot|11mon ago
Thank you for making that! I was using a plugin to export to markdown but it wasn't ideal.
shadowgovt|11mon ago
Super cool. Well done! I've been wanting this for awhile; glad to see it.
startupsfail|11mon ago
Would appreciate support for comments, with CriticMarkup or something.
jcastro|11mon ago
This is going to save me so much time, thank you for this!
peterarmstrong|11mon ago
Thank you from Leanpub!
whycome|11mon ago
Google keep…
zameerb1|11mon ago
[dead]
Freak_NL|11mon ago
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|11mon ago
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|11mon ago
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.
paulgb|11mon ago
It's only available in certain paid versions (https://workspaceupdates.googleblog.com/2022/12/format-displ...)
Which is too bad, it's the one thing keeping me from writing design docs in google docs.
crazygringo|11mon ago
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|11mon ago
Code blocks are a paid feature, but the Markdown import/export feature is not paid. It's just still rolling out
judge2020|11mon ago
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|11mon ago
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|11mon ago
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.
codetrotter|11mon ago
> 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.
promiseofbeans|11mon ago
It would let you paste a lot of existing markdown into google docs
Freak_NL|11mon ago
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.
stevemk14ebr|11mon ago
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.
underdeserver|11mon ago
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.)
akersten|11mon ago
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 `