google-apps-scriptmarkdowngoogle-docsgoogle-docs-api

Convert a Markdown text file into a Google Document


I am trying to migrate a load of documentation which was written in markdown into a Google Doc so it can be used by our marketing department.

Is there a mechanism using Apps Script/ Google Docs API that I can import a file and convert it to a Google Doc using a predefined template?
Eg H1s will map to Title, etc


Solution

  • There is a new (and IMO much simpler) option in google docs.

    1. Copy markdown text into your clipboard.
    2. The Paste From Markdown option is off by default. Enable it by going to Tools->Preferences->Enable Markdown.
    3. In the top menu select the following: Edit->Paste From Markdown screenshot of menu in google docs

    4. That's it! Text should be formatted correctly

    Note: I had to use Google Chrome browser. In Firefox I get the message

    "This action is unavailable in your browser, but you can still convert a Markdown file to Docs format through Drive."