feat: add docs update command for editing Google Docs#219
Merged
steipete merged 12 commits intoopenclaw:mainfrom Feb 13, 2026
Merged
feat: add docs update command for editing Google Docs#219steipete merged 12 commits intoopenclaw:mainfrom
steipete merged 12 commits intoopenclaw:mainfrom
Conversation
goncaloalves
added a commit
to goncaloalves/gogcli
that referenced
this pull request
Feb 11, 2026
- Add 'gog slides update' command with markdown formatting - Create slides_formatter.go for Google Slides API batch updates - Create slides_markdown.go for markdown parsing (titles, bullets, code) - Add slides.go with update/create/read operations - Update googleauth service for Slides scope Related: PR openclaw#219
Phase 1 & 2 complete: - Markdown parser supporting headings, lists, code blocks, blockquotes, links - Google Docs API integration for formatting - --format markdown flag for docs update command - Heading styles (H1-H6), horizontal rules, list indentation - Code blocks with monospace font Pending (Phase 3): - Inline formatting (bold, italic, inline code) - index calculation issues - Links - index calculation issues Usage: gog docs update <docId> --content-file ./doc.md --format markdown
- Simplified document generation to avoid index calculation errors - Fixed ParseInlineFormatting to correctly track positions - Preserves: headings, code blocks, blockquotes, lists, horizontal rules Pending: inline formatting (bold, italic, code, links) - indices still need work
- Fixed markdown formatter to use UTF-16 code units instead of UTF-8 bytes - Added utf16Len() helper function for accurate character counting - Fixed inline formatting indices (bold, italic, code, links) - Added empty line handling (MDEmptyLine) - Successfully tested with Docker course doc (21KB, emojis, diagrams) This resolves index mismatch errors caused by multi-byte characters like emojis which are 4 bytes in UTF-8 but 2 code units in UTF-16.
- Add 'gog slides update' command with markdown formatting - Create slides_formatter.go for Google Slides API batch updates - Create slides_markdown.go for markdown parsing (titles, bullets, code) - Add slides.go with update/create/read operations - Update googleauth service for Slides scope Related: PR openclaw#219
…tion - Fixed slides creation to use CreateShape with TEXT_BOX instead of inserting text directly - Direct text insertion into slides is not supported by Google Slides API - Added title text box with bold 36pt font - Added body text box for content (bullets, paragraphs, code) - Supports markdown formatting (bold, bullets, code blocks) Tested: Successfully created 20-slide presentation from Docker course outline
7bfb533 to
d2db0cc
Compare
Collaborator
|
Landed via temp rebase onto main. Thanks @goncaloalves! |
klodr
pushed a commit
to klodr/gogcli
that referenced
this pull request
Apr 22, 2026
* feat: add docs update command for editing Google Docs * fix: handle document content range correctly for replace * docs: add Jarbas avatar * feat(gogcli): add markdown formatting support for Google Docs Phase 1 & 2 complete: - Markdown parser supporting headings, lists, code blocks, blockquotes, links - Google Docs API integration for formatting - --format markdown flag for docs update command - Heading styles (H1-H6), horizontal rules, list indentation - Code blocks with monospace font Pending (Phase 3): - Inline formatting (bold, italic, inline code) - index calculation issues - Links - index calculation issues Usage: gog docs update <docId> --content-file ./doc.md --format markdown * fix(gogcli): fix inline formatting indices in markdown formatter - Simplified document generation to avoid index calculation errors - Fixed ParseInlineFormatting to correctly track positions - Preserves: headings, code blocks, blockquotes, lists, horizontal rules Pending: inline formatting (bold, italic, code, links) - indices still need work * fix(gogcli): use UTF-16 code units for Google Docs API indexing - Fixed markdown formatter to use UTF-16 code units instead of UTF-8 bytes - Added utf16Len() helper function for accurate character counting - Fixed inline formatting indices (bold, italic, code, links) - Added empty line handling (MDEmptyLine) - Successfully tested with Docker course doc (21KB, emojis, diagrams) This resolves index mismatch errors caused by multi-byte characters like emojis which are 4 bytes in UTF-8 but 2 code units in UTF-16. * feat(gogcli): add slides commands with markdown support - Add 'gog slides update' command with markdown formatting - Create slides_formatter.go for Google Slides API batch updates - Create slides_markdown.go for markdown parsing (titles, bullets, code) - Add slides.go with update/create/read operations - Update googleauth service for Slides scope Related: PR openclaw#219 * fix(gogcli): use shapes for slides text boxes instead of direct insertion - Fixed slides creation to use CreateShape with TEXT_BOX instead of inserting text directly - Direct text insertion into slides is not supported by Google Slides API - Added title text box with bold 36pt font - Added body text box for content (bullets, paragraphs, code) - Supports markdown formatting (bold, bullets, code blocks) Tested: Successfully created 20-slide presentation from Docker course outline * feat: add markdown table support (formatted text output) * feat: implement native Google Docs table insertion with multi-step API * feat(slides): add --template flag for creating presentations from templates * fix: stabilize docs/slides markdown + auth flow (openclaw#219) (thanks @goncaloalves) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive markdown support to
gog docs updateandgog slidescommands, enabling rich formatting conversion from markdown to native Google Docs/Slides elements.Features Added
📄 Docs Update Command (
gog docs update)Core functionality:
Markdown → Google Docs conversion:
**text**) → Bold formatting*text*) → Italic formatting`code`) → Monospace font[text](url)) → Clickable hyperlinks- item,* item,1. item) → Bullet/numbered lists```) → Monospace + gray background> text) → Indented paragraphs---,***,___) → Separator linesTable support:
📊 Slides Commands (
gog slides)New commands:
gog slides create— Create new presentationgog slides update— Update slides with markdown contentgog slides template— Create from templates (--templateflag)Markdown → Google Slides conversion:
Usage Examples
Technical Details
UTF-16 Indexing:
Google Docs API uses UTF-16 code units for character positions. This PR correctly handles multi-byte characters (emojis, special characters) by using
utf16Len()instead of byte length.Native Table Insertion:
Tables require multi-step operations:
InsertTableRequestSee
docs_table_inserter.gofor implementation.Files Changed
internal/cmd/docs.gointernal/cmd/docs_formatter.gointernal/cmd/docs_markdown.gointernal/cmd/docs_markdown_test.gointernal/cmd/docs_table_inserter.gointernal/cmd/slides.gointernal/cmd/slides_formatter.gointernal/cmd/slides_markdown.gointernal/googleapi/slides.gointernal/googleauth/service.goStats
Testing
Tested with real documents including:
All inline formatting (bold, italic, code, links) working correctly with UTF-16 indexing.
Built with 🔪 by Jarbas (Gonçalo's AI assistant)