I currently have a script that generates an amount of text. I want this script to be able to output some text with a formatting style into STDIN (preferably MD/HTML) and I can then paste it into Google Docs. For example, if the program outputs something like this (if you could paste markdown):

# Header

## Subheader
More text

I want to be able to copy-paste this into Google Docs with the # Header part as Header 1 style, ## Subheader part to be Header 2 style, and the other to be plain text style. Is there any way I can do this?

1 Answer 1


Built-in markdown supported in Google Docs is limited. Unfortunatelly the markdown that you want to use is not supported. For details see Use Markdown in Google Docs, Slides, & Drawings.

You might explore the Google Workspace Marketplace for apps that are able to connect to Google Drive and use one those apps, i.e. StackEdit (I have not used it recently)

  • Thanks! In that case, is there any way that my program can output some type of formatting for me to paste into Docs with said formatting?
    – WarriorX
    Commented Apr 26, 2022 at 0:59
  • @WarriorX If your program is done using Google Apps Script use the Documents Service to add the content and apply the required formatting. If you are using another programming platform use the Google Docs API. Commented Apr 26, 2022 at 1:02
  • My program outputs its text into stdout. Can I make it output in a format such that Docs will be able to change it into its own formatting? (I'm trying to make a program to generate a Docs file)
    – WarriorX
    Commented Apr 26, 2022 at 1:04
  • I don't know what is stdout. Better to ask on Stack Overflow. Commented Apr 26, 2022 at 1:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.