Publishing RMarkdown to Google Docs

I've used a Google apps script to convert huge Google docs to markdown. I used it at work to move process documentation in Google docs to a markdown based wiki with pretty good success. It handled things like bullets and tables and images really well. It did not handle some font variation as sizing well, though. That said, I feel like it should be possible to automate adding and calling a bit of JavaScript like this on the Google doc to convert the text to a close enough option for using in Rmarkdown.