Opens .gdoc, .gsheet, and other Workspace shortcut files in Obsidian's Web Viewer by parsing JSON metadata (url, resource_id, or doc_id). Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|---|---|---|
| src | ||
| test | ||
| .gitignore | ||
| esbuild.config.mjs | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| styles.css | ||
| tsconfig.json | ||
GDocs
Obsidian plugin that opens Google Drive shortcut files in Obsidian's Web Viewer.
When Google Drive for Desktop (or similar sync) stores Docs, Sheets, and other Workspace files in your vault, they appear as small JSON files (.gdoc, .gsheet, etc.). GDocs registers those extensions, shows them in the file explorer with their extension, and opens the linked Google URL in a tab when you click them.
Requirements
- Obsidian 1.8+ (desktop for Web Viewer)
- Web Viewer core plugin enabled: Settings → Core plugins → Web viewer
- Google Drive shortcut files in your vault (from Drive for Desktop, rclone, Synology Drive, etc.)
Supported extensions
| Extension | Google app |
|---|---|
.gdoc |
Docs |
.gsheet |
Sheets |
.gslides |
Slides |
.gdraw |
Drawings |
.gform |
Forms |
.gtable |
Tables |
.gscript |
Apps Script |
.gjam |
Jamboard |
Installation (development)
- Clone this repo into your vault's
.obsidian/plugins/gdocsfolder, or symlink it there. - Install dependencies and build:
npm install
npm run build
- Enable GDocs under Settings → Community plugins.
- Reload Obsidian.
For development, run npm run dev to watch and rebuild.
Usage
Click any .gdoc, .gsheet, or other supported shortcut in the file explorer. The plugin reads the url field from the JSON file and opens it in Web Viewer.
If Web Viewer is disabled, GDocs can open the link in your system browser instead (see plugin settings).
Mobile
Web Viewer is not available on mobile. GDocs shows the URL with Copy link and Open in browser buttons.
Shortcut file format
Shortcut files are JSON. Google Drive for Desktop typically uses:
{
"doc_id": "1VxFROKm0zoJV2iH678wO94hZ0PY9fN_gAGOxhZacc8w",
"email": "you@example.com"
}
GDocs builds the Docs/Sheets URL from doc_id and the file extension (.gdoc, .gsheet, etc.).
Older or third-party sync tools may use:
{
"url": "https://docs.google.com/spreadsheets/d/…/edit",
"resource_id": "spreadsheet:…"
}
Troubleshooting
-
Files not visible in the explorer
Check Settings → Files & links → Detect all file extensions, and ensure.gdoc/.gsheetare not listed under Excluded files. -
Opens in browser instead of Obsidian
Enable the Web Viewer core plugin, or turn on “Open in system browser when Web Viewer is off” in GDocs settings. -
Warning about moving shortcut files
Do not move.gdoc/.gsheetfiles out of a syncing Google Drive folder; Google may delete the online document.
License
MIT