Amusing: Downloadable version of google docs
Downloadable version of google docs | |
Downloadable version of google docs | |
Downloadable version of google docs |
uid / gdoc-downloader
is a Python script that downloads Google Docs as plain text files (with LaTeX markup), which enables collaborative workflows. For example, co-authors can simultaneously edit the same LaTeX files without fear of merge conflicts.
Basic usage
Run:
to download a single Google Doc (specified by either URL or .gdoc filename), convert it to plain text (with special encoding for LaTeX symbols), and pipe to . Note that the file cannot be private; it must be viewable (or editable) by anyone with the link.
For example, run:
to download this LaTeX file to . Note that the script ignores navigational markers and content before and after and tags, respectively.
Downloading multiple files
Run:
to download a set of Google Docs to your computer in parallel, which is faster than running separately for each file. Customize the list in to specify which files to download. Here is an example configuration:
Running this script will download the first file and save it as , the second as , and the third as .
This script terminates only when all of the files have been downloaded.
Downloading and compiling LaTeX
Run in the top-level directory to execute the following contents of the :
This will download three Google Docs LaTeX files specified in and run to compile them into .
Note that some of files required by the LaTeX document (e.g., and ) are stored locally, not in Google Docs. So you do not need to put everything in the cloud.
LaTeX syntax highlighting
We include a Google Apps Script script that syntax-highlights the LaTeX syntax. The script must be triggered by selecting the menu command . It does not update automatically, so you have to select the command again whenever you've made edits.
To install the highlighter:
- Find syntax-highlighter.gs in this repo and copy its contents to your clipboard
- In your Google Doc, go to .
- Create a blank project.
- Paste the script code you copied from syntax-highlighter.gs into the script editor, and save it.
- Go back to your Google Doc and reload it in your browser. You should now see the menu.
It can be helpful to do manual syntax highlighting as well, for the benefit of yourself or your co-authors. For example, you can downplay a passage of text by making it tiny or gray, or call attention to it by enlarging or reddening or yellow-highlighting it.
Collaborative LaTeX workflow
Here is how multiple people can simulataneously edit and compile LaTeX files using these scripts:
- Create a Dropbox folder shared amongst all co-authors.
- Put the scripts in this repository into the shared Dropbox folder.
- Put auxiliary files (e.g., style and image files) into the shared Dropbox folder.
- Create Google Docs representing LaTeX files (example), make them world-writable, and add their URLs and filenames to .
- Now all co-authors can simultaneously edit the Google Docs online without conflicts.
- To compile a PDF, run in the shared Dropbox folder.
The benefits of this workflow over traditional version control systems are:
- lack of merge conflicts
- seeing everyone's edit cursors
- comments and todos in Google Docs margins
- in-document chat window
- revision history diff view is good (as long as each individual LaTeX file is not huge)
However, some drawbacks are:
- cannot use your own favorite text editor
- requires Internet access to write in Google Docs (it is possible to write offline, but then merge conflicts can result)
- navigating through a long document feels slow (but section headings and Table of Contents help)
-
-
-