How can I convert a Google Docs, which contains images and tables, into a Markdown file which can be published as a post using Jekyll?
Is it possible to first export the Google Docs into a PDF and then convert the PDF to Markdown? What will happen to the images and tables in that case?
Docs to Markdown (GD2md-html) converts Google Docs to simple, readable Markdown or HTML. Now open-source! This add-on allows you to create documents using the excellent editing and collaborative features of Google Docs, then convert to Markdown or HTML that you can store as text files using a version-control system.
You have to manually turn it on in the settings first. That's why I'm writing this post. If you want to enable Markdown support, open a document in Google Docs, head over to the top of the screen, go to “Tools” then “Preferences” and enable “Automatically detect Markdown.” After that, you're good to go.
There is no direct way to quickly convert a Google Doc into Github or your own website. However, you can convert your Google doc to markdown or HTML and then use the result in your Github or own website.
The script originally suggested in this answer appears to no longer work and has not been updated for 5 years.
An alternative solution (which is based on the old script) can be found at https://github.com/evbacher/gd2md-html
I tried it out, it works pretty well.
You can use a Google Script to do the conversion for you!
This one will let you convert to .md and it will email you the converted file. I've tested it and works fine. It works with basic tables, and if you have images in the doc, it will attach them to the email.
Instructions for installing are on the same link, in the GitHub description, but I pasted it here for ease of access:
Add the script:
Run the script:
Good luck!
You can export as HTML. Jekyll can serve static HTML files.
Btw, "standard" markdown doesn't have tables. There are implementation that have it, but I'm afraid you'll have to convert them by hand to the right format, which will be implementation dependent. I don't know about Jekyll, maybe it's easiest to just use HTML tables within the markdown text.
You could create a new theme based on the HTML export. The export should contain the stylesheet embedded in a <style>
tag within the HTML document. It's not really easy to create new themes, but doable. Or, if you just want the content and don't mind using whatever Jekyll theme you already have, then you can cut out the stylesheet part and keep the html only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With