Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gasparl/tidystats-google-docs-add-in
A Google Docs add-in for inserting statistics using the tidystats R package.
https://github.com/gasparl/tidystats-google-docs-add-in
google-docs r statistics tidystats
Last synced: 14 days ago
JSON representation
A Google Docs add-in for inserting statistics using the tidystats R package.
- Host: GitHub
- URL: https://github.com/gasparl/tidystats-google-docs-add-in
- Owner: gasparl
- License: mit
- Created: 2022-04-05T17:23:30.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-02T16:11:17.000Z (over 2 years ago)
- Last Synced: 2024-07-30T18:53:18.147Z (3 months ago)
- Topics: google-docs, r, statistics, tidystats
- Language: TypeScript
- Homepage:
- Size: 1.95 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tidystats Google Docs add-in.
This software is an add-in for Google Docs to insert statistics from a file created with the [tidystats](https://github.com/WillemSleegers/tidystats) R package. For more information about _tidystats_, please visit the [_tidystats_ website](https://www.tidystats.io/).
This Google Docs add-in is written in [Google Apps Script](https://developers.google.com/apps-script/overview) (Google's Javascript-based development platform for building applications and add-ons for Google Sheets, Docs, Forms and other Google Apps), built on the boilerplate project available via [https://github.com/enuchi/React-Google-Apps-Script](https://github.com/enuchi/React-Google-Apps-Script) (which can be consulted for details about the code structure).
### Installation
Later on, the add-in is to be published and available among the official Google add-ins for easy installation. For now, it can only be installed "manually", as follows.
**1.** Make sure you are running at least [Node.js](https://nodejs.org/en/download/) v10 and `npm` v6.
**2.** You need to enable the Google Apps Script API. You can do that via [script.google.com/home/usersettings](https://script.google.com/home/usersettings).
**3.** Clone the repo and install the dependencies.
```bash
git clone https://github.com/gasparl/tidystats-Google-Docs-add-in.git
cd React-Google-Apps-Script
npm install
```**4.** Next, you need to log in to [clasp](https://github.com/google/clasp) that allows managing Google Apps Script projects locally.
```bash
npm run login
```**5.** Update the `.clasp.json` file in the root of this project with the following three key/value pairs:
```json
{
"scriptId": "1PY037hPcy................................................",
"parentId": ["1Df30......................................."],
"rootDir": "./dist"
}
```- `scriptId`: Your existing script project's `scriptId`. You can find it by opening your document, selecting **Tools -> Script editor** from the menubar, then **File -> Project properties**, and it will be listed as "Script ID".
- `parentId`: An array with a single string, the ID of the parent file (Google Document) that the script project is bound to. You can get this ID from the url, where the format is usually `https://docs.google.com/document/d/{id}/edit`. This allows you to run `npm run open` and open your file directly from the command line.
- `rootDir`: This should always remain `"./dist"`, the local build folder that is used to store project files.
Now you can run the deploy command to compile and upload the scripts to the specified Google Document. (You may be prompted for confirmation to update your manifest file; select "yes".)
```bash
npm run deploy
```The deploy command will build all necessary files using production settings, including all server code (Google Apps Script code), client code (React bundle), and config files. All bundled files will be saved to the `dist/` folder, and then pushed to the Google Apps Script project.
Now you can open or refresh the Google Document and you should see the new menu "_tidystats_". (You can also run `npm run open` to open the document.) You can also see the uploaded Google Apps Scripts via **Tools -> Script editor**.
### Support
Found a bug or got an idea about how to improve the add-in? Please create a [Github issue](https://github.com/gasparl/tidystats-Google-Docs-add-in/issues). If you need some help figuring out how this works, see this support [page](https://help.github.com/en/articles/creating-an-issue) by Github or simply contact Willem Sleegers on [Twitter](https://twitter.com/willemsleegers) or via [e-mail](mailto:[email protected]).