Import and Export Markdown in Google Docs
workspaceupdates.googleblog.com
workspaceupdates.googleblog.com
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...
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.
This source code: http://hub.scroll.pub/slideshowdemo/index.scroll
Produces this HTML: http://hub.scroll.pub/slideshowdemo/
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.
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.
The existence of comments about how certain elements were rendered on export made me think that something was missing when compared with CM.
I won't support directly importing Markdown as DOCX. For that you could convert from Markdown to Docs to DOCX though.
This will make a huge difference to a lot of my work.
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?
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.
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
Any hint on why you have used square brackets?
See https://daringfireball.net/projects/markdown/syntax#link
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.
Well, you solved it. Thanks!
Just curious: Google docs supports a lot more than what Markdown has syntaxes for - how do you deal with this when exporting to markdown?
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
```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.
Looking at you HN... (ok at least we have 2 indents codeblock)
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.
> Just a tiny hint that any paragraph like this starting with a greater-than sign is a quote.
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.
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.
Which is too bad, it's the one thing keeping me from writing design docs in google docs.
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.
It opens a block and you can select Java. (There's only a relatively small number of syntaxes supported, but still.)
and
(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.
The lack of MD support makes manual IO from Docs to your favorite LLM lossy (or very annoying). Cool that it's fixed.
Google Docs -> Markdown -> Hugo website was a great workflow: https://github.com/whyboris/utilitarianism.net
[1] https://workspace.google.com/u/0/marketplace/app/docs_to_mar...
Writing in markdown and converting to .tex is actually a quite popular way of doing that these days.
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.
I have this in my shell history:
pandoc --from=docx --to=asciidoc --wrap=none --atx-headers --extract-media=img doc.docx > doc.adocI 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
One tip for pasting without formating, at least in Windows, is CTRL+SHIFT+V.
Could you build a confluence/wiki like system on top of this?
Thank you to the people who made this happen! May you continue your great work for a long time to come!
Meanwhile, Trello is once again threatening to force everyone onto the new rich-text editor and disable the old markdown one.
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
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.
I hope the "new tab experience" is rolled out to non-workspace users too. The tab + markdown export combination would make Google Docs a great blog editor!
look forward to trying this.
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.
Even though Notion is now better on many fronts as you said, people who have to stick to Google Docs benefit from Notion's existence in that way.