gemini-cli-extensions / gemini-cli-extensions/workspace

Feature request: docs.appendMarkdown — write formatted Docs content without manual index math

Open
#400 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
638
Forks
107
PR merge metrics
No merged PRs in 30d

Description

Problem

Producing a formatted Google Doc today takes the two-step flow the google-docs skill teaches: docs.writeText with plain text, then docs.formatText with hand-computed 1-based character indices. The skill spends most of its length teaching the model index arithmetic ("count the \n characters..."), and any miscount styles the wrong range. For agents, markdown is the native output format — the index math is pure failure surface.

Proposal

docs.appendMarkdown(documentId, markdown, tabId?): converts a markdown string to natively formatted Docs content in a single call.

  • Supported: headings (#######), **bold**, *italic*, ~~strikethrough~~, `inline code`, [links](url), bullet (- ) and numbered (1. ) lists
  • One insertText with the plain text, then one batchUpdate with updateParagraphStyle / updateTextStyle / createParagraphBullets requests computed from parse offsets — no client-side index math ever reaches the model
  • tabId optional, default tab when omitted (same convention as docs.writeText)
  • Not in scope for v1 (documented): tables, horizontal rules, images — they degrade gracefully to plain text / are skipped with counts in the response

No new OAuth scopes (documents already covers it). Complements rather than replaces docs.formatText, which remains the right tool for fine-grained edits to existing text.

I have a working implementation (pure parser module + service method) with Jest coverage ready to submit as a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the pure parser module and the service method described in the issue, then read the existing docs.writeText and docs.formatText flows first. Verify the Jest coverage for headings, inline styles, links, lists, tabId handling, and graceful degradation before extending it. Done means docs.appendMarkdown produces native formatting through the Google Docs requests without requiring caller index math.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.