Realtime Markdown preview in Google Docs with syntax highlighting
Available in Google web store: https://chrome.google.com/webstore/detail/preview-markdown/hlcflgaamnhiibdebkjbojhfkkckkjif?authuser=0
On an existing Google docs,
- Click Add-ons -> Get Add-ons...
- Search for
Markdown
- Click
+ FREE
to install this for your document - Continue working on your document as the preview will be updated in real-time in the sidebar.
- Open your Google Drive document (http://drive.google.com)
- Tools -> Script Editor > Create script for blank project
- Clear the default
Code.gs
file and paste the contents of Code.gs into the code editor - Add a new HTML file (File -> New -> HTML File) with the name
Sidebar.html
and paste the content of Sidebar.html into the code editor - File -> Save (or
Ctrl/⌘ + S
) for both open files - When prompted enter new project name for 'Untitled project', e.g. 'Preview Markdown'
- Close the window, return to the GDocs window and follow Add-ons -> Preview Markdown -> Start
All credit goes to the showdown.js and highlight.js as these libraries made this possible.