Skip to content

Automattic/google-docs-add-on

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
George Hotelling
Jul 23, 2021
71aa40d · Jul 23, 2021
Nov 20, 2020
Jul 23, 2021
Jan 28, 2021
Nov 20, 2020
Mar 29, 2017
Nov 20, 2020
Jan 27, 2017
Dec 19, 2016
Nov 20, 2020
Nov 20, 2020
Jun 30, 2017
Mar 1, 2017
Mar 1, 2017
Jul 23, 2021
Nov 20, 2020
Nov 20, 2020
Nov 20, 2020

Repository files navigation

Getting started

The add-on lives in Google's Script Editor but, in keeping with best practices, this repo is the source of truth, and the script editor will be overwritten with local changes.

Configuring

This process needs to be performed once:

  1. npm install to install all dependencies
  2. Create a new apps script here: https://script.google.com
  3. Get the script ID from the URL (everything between the /d/ and /edit - script.google.com/a/google.com/d/SCRIPT_ID_HERE/edit)
  4. Install clasp
  5. ``
  6. Create a new WordPress.com App:
    1. Set the redirect URL to be https://script.google.com/macros/d/SCRIPT_ID/usercallback
    2. Make a note of the app client ID and client secret
  7. In the app script, go to File and Project Properties
    1. Select the Script properties tab
    2. Add OauthClientId and set the value to your app
    3. Add OauthClientSecret and set the value to your app

Everything is now setup.

Deploying

npm run deploy

This will use node-google-apps-script to upload the src directory to the add-on's script editor.

Testing

In the script editor choose "Publish" → "Test as add-on…" and then select a document to test with.

That will open a new window with your document. You will then see your project in the Add-ons menu.