-
Notifications
You must be signed in to change notification settings - Fork 593
feat: gog docs insert-image — upload + embed local image into a Google Doc #648
Copy link
Copy link
Open
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
There is no first-class gog command to embed a local image into a Google Doc.
Today the workflow for a markdown-to-Docs pipeline looks like:
references and replace each with a unique text placeholder.gog docs write --replace --markdown(the placeholder survives the write).gog drive upload <local.png> --parent <folderId>— gog covers this nicely.gog drive share <fileId> --to anyone --role reader— gog covers this too.documents.batchUpdatewithinsertInlineImage← no gog equivalent.gog drive unshare <fileId> <permId>— gog covers this.Step 5 forces every consumer to import
google-api-python-client(or equivalent) and re-implement: walk the doc body, find placeholder ranges, sort descending, then issuedeleteContentRange+insertInlineImagebatchUpdates.Proposal
Semantics:
<doc-name>-imagesfolder).documents.batchUpdatewithinsertInlineImageat the requested anchor.--at <placeholder-string>— replace literal text matches (most useful for markdown pre-processing pipelines).--at end— append at end of document.--at heading=h.<id>— insert after a named heading (matches the anchor-link resolution gog already does indocs write).Workspace-policy fallback
Some Google Workspaces forbid
anyonesharing (publishOutNotPermitted). In that caseinsertInlineImagewill fail because Google's image fetcher needs anonymous access.Suggested behaviour when public sharing is blocked:
publishOutNotPermittederror and surface it clearly.--on-restricted=linkfallback: replace the placeholder with a clickable Drive link to the uploaded image, so the user can manuallyInsert > Image > Drivein the editor. Today every consumer reinvents this same fallback.Related
insert-imageis the natural next building block for image-bearing documents.docs(insert) anddrive(upload + share/unshare) — sits cleanly on top of existing surface.