Google Drive and Markdown

This topic is related to Recruiting / ATS Systems? and to Notes/reference/writing workflows and https://community.effectiveremotework.com/t/text-file-setup-and-workflow/231

I’ve been thinking recently that it would be awesome if I could edit files locally in Markdown and then have them sync as Google Docs with Google Drive.

Why this would be so great

It would definitely be really great for my recruiting purposes, because I could put a link to a Google Doc notes file for the candidate on each row and have that sync as a locally editable file.

That’s better than using only Google Docs because when I get on the phone with a candidate, unless I have the Google doc or Lever profile already open I just bring up Sublime text to start capturing notes. Even the interface is easier because typing “##” is easier than selecting “Heading 2” in the Google Docs menu bar.

However, Google Drive has the major advantage that it’s collaborative with the rest of the world and any teammate regardless of whether they care to write in Markdown or not.

It would also be my favorite reference system because sometimes I capture or receive Google Doc files from others. They could live along side my local files and I can work on them on either local or online context.

Ways of making this happen

Using Stack Edit

This is a bit of a workaround and not quite the ideal but it’s about 50% there. StackEdit is an online Markdown editor, and it is possible to connect it to your Google Drive. Then, if you’re syncing .md files to Google Drive using the Drive OS X app, you can open the file in StackEdit from drive.google.com by clicking “Open with StackEdit.”

This is only a partial solution because it’s actually avoiding the use of Google Docs and the benefits of real-time editing. It’s more of a Markdown / Drive solution, but it is still more collaborative than using dropbox for the .md syncing, assuming that you explain to your partners that they can open it with StackEdit.

I’ve read that StackEdit can also export to fully “rendered” Google Doc file, but I’m not sure if this is actually possible.

Markdown to Google Docs Script

There are some available scripts, though I haven’t tried them, for exporting Markdown to a Google Doc file automatically.

I imagine it’s possible because I can literally copy any rendered HTML file and paste it into Google Docs.

Since I do most of my capturing with Sublime, I could write a command for Sublime to export whatever file I’m working on directly to a google doc in my drive.

Better yet, I could try programming Hazel to automatically turn any .md file into a corresponding Google Doc file (I think of this as Google Doc being the rendered HTML). This way I can use any markdown editor.

I am not sure if Hazel will detect changes to the .md file immediately upon saving or if it runs on some time-based schedule. @joebuhlig Do you know?

Google Docs to Markdown Script

There are also scripts available for the other way around. Google Docs to markdown. I’ve tried the drive add-on associated with this script and it works really well.

If I can detect when a change is made to a Google Doc file and then edit the associated .md file, then the system would work both ways. The .md file and Google Drive would always be in sync.

The script takes about 3 seconds to run, so it is not real time, and I have some trouble anticipating how this may cause trouble with versioning. Also, I would need to make sure that it doesn’t run into an infinite loop converting back and forth assuming that the conversion changes something like spacing every time. I have tried going back and forth a few times and visually the renderings look identical but the code might not be exactly the same.

This is a cool idea. But why convert it at all?

Are there others editing it at the same time as you? Are trying to stay collaborative with it? Or do you just like storing a Google Doc and editing in Markdown?

Last I knew, it’s based on the Last Modified date which only changes when a save happens.

But since you’re using Sublime Text, I vaguely remember a package for it that would autosave every few minor edits. But I can’t recall what it was at all.

Speaking of packages, is there a ST package that could do this for you?

This is a cool idea. But why convert it at all?

The reason to convert it is to make it editable through a permalink.

For instance, right now my main issue with switching to Google Spreadsheets from Lever is the question of where to store the notes. That’s easily solved if the table row can look like this:

Name Position Notes
Tyler iOS Developer docs.google.com/document/d/Dfji2dfsdjf/edit
Joe Web Developer docs.google.com/document/d/dfWetdsxv/edit

If the Notes URL looked like this file:///Users/tylerweitzman/Documents/Engineers/Joe.md then not only does it only work on my personal machine, but I can’t even edit it after I click the link.

I want both to be able to edit it off of a perma link myself and I also want a teammate who clicks the link to be able to view and edit it too.

There’s tons of Markdown-related sublime text packages but no Google Docs ones as far as I could find.

1 Like

I’m somewhat running into an opposite issue. I work for a company that is 80% comprised of engineers and architects. We started a blogging initiative because our community loves when we create technical content.

We primarily work in the Google Drive and use Google Docs to collaborate (make suggestions/edits) on various content pieces.

There were a few team members that created blogs in Markdown. Now, I can copy and paste that text into a Google Doc, but it misses the formatting.

I tried StackEdit, but you have to be a sponsor in order to export a Markdown file to a Word doc, to then import back into the Drive and open as a Google Doc (seems step-heavy, honestly). Is there any extension or app in which you can convert the text format within a Doc from Markdown styling? Or is there a tool where you can collaborate on Markdown files within the Google Drive?

Open to all suggestions, here. Trying to make the dev’s lives easier, as well as my own. :slight_smile:

https://stackedit.io/

StackEdit could be an option for you. It integrates with Google Drive and can handle Markdown files (both import and export).

Also, welcome to the community @cnck!

Justin I think he tried StackEdit and wasn’t able to get it to work for his use case of converting MD to GDoc.

@cnck Is it necessary to actually do this conversion? StackEdit let’s you edit the markdown in a full graphical editor and the proper formatting. If you add it as an app on Google Drive where the .md files are stored you can essentially have an equivalent experience to Google Doc editing but on a markdown file. Only limitation is that it is not “real-time” the way that Google docs are.

If all you want is to convert a large number of markdown files into google docs I have a solution for you but you would need one of your engineers to do it— run pandoc with bash on all the markdown files to convert all of them into word docs instantly, then import into G Drive.

1 Like