Skip to content

Instantly share code, notes, and snippets.

@zombiecalypse
Created June 24, 2014 22:12
Show Gist options
  • Save zombiecalypse/fae99cb1537f6027f163 to your computer and use it in GitHub Desktop.
Save zombiecalypse/fae99cb1537f6027f163 to your computer and use it in GitHub Desktop.
Editing Google Docs locally as markdown with vim
#!/bin/sh
# Use as google docs edit --title "Reviews Regex Parse" --editor vim-html-markdown --format htm
file=$1
markdown=`tempfile --suffix=.mdown`
# Convert to markdown with pandocs
pandoc "$file" -f html -t markdown -o $markdown
# Edit the markdown file
vim $markdown
# And convert it back to html, which can be uploaded to Google Docs
pandoc $markdown -f markdown -t html -o "$file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment