Google-sheets – a cut and paste approach to converting a chunk of a google spreadsheet to markdown table

copy/pastegoogle sheetsgoogle-apps-scriptmarkdown

I maintain my web site in a version of markdown, with the common table extension.

I maintain my inventory as a google spreadsheet.

I'd like a quick way to copy paste a chunk of a spreadsheet, and get it out as markdown. Failing that, pointers to a google-api script that does this.

In passing things I tried:
1. Copy and paste into document. (It works for gmail, why not?) Result: Alphabet soup.

  1. Prepare a spreadsheet chain. Sheet 1 is blank. Sheet 2 has columns that reference sheet one, but Sheet2 col B references Sheet 1 col A Col D references B, and so on. The odd columns are markdown text. This works but is incredibly ugly.

  2. A second version of this calculates the longest element in each column, and pads all other elements with blanks. This produces better results, but it's still a pain to maintain.

A google search for google sheets markdown found several things that work badly.

Best Answer

Actually the answer is trivial: Google webapps has

MarkdownTableMaker

https://chrome.google.com/webstore/detail/markdowntablemaker/cofkbgfmijanlcdooemafafokhhaeold?hl=en

Works reasonably well.