feat(docs): improve markdown layout controls#636
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-22 15:40 UTC / May 22, 2026, 11:40 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: not applicable. as a PR review; the linked problems have source-level and CLI repros in the PR body/context, but I did not run live Google Docs mutation commands in this read-only review. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the focused Docs markdown/layout implementation after normal maintainer review and any desired live Google Docs smoke proof, keeping the explicit sizing flags rather than changing pageless width by default. Do we have a high-confidence way to reproduce the issue? Not applicable as a PR review; the linked problems have source-level and CLI repros in the PR body/context, but I did not run live Google Docs mutation commands in this read-only review. Is this the best way to solve the issue? Yes, with the usual maintainer validation: explicit page-size/margin flags avoid silently widening existing pageless documents, and the Markdown fixes are narrowly scoped to Drive import/local rendering paths. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 23e74af31471. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7f51c6117
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else if marker == fenceMarker { | ||
| inFence = false |
There was a problem hiding this comment.
Track full fence length before leaving fenced code blocks
normalizeMarkdownTablesForDriveImport treats any line that starts with ``` or ~~~ as an opening/closing fence token, but it only records the 3-character marker and not the actual fence length. In Markdown, a block opened with four backticks can legally contain a line of three backticks as content, so this logic can exit inFence too early and then rewrite `| ... |` lines that are still inside the code block. That silently mutates code examples during `docs write --replace --markdown` instead of leaving fenced content untouched.
Useful? React with 👍 / 👎.
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Sunspot Lint Imp Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
Summary
#heading-sluglinks to native Google DocsheadingIdlinks.docs writeanddocs page-layout:--page-width,--page-height,--margin-left,--margin-right,--margin-top,--margin-bottom.--pagelessunless sizing flags are explicit, and by lettingdocs page-layout --page-width ...preserve the current page mode unless--layoutis also supplied.Fixes #629.
Fixes #630.
Fixes #632.
Fixes #633.
Notes
GOG_KEYRING_PASSWORD.Verification
go test ./internal/cmd -run 'TestDocsWrite_InvalidLayout|TestNormalizeMarkdownTables|TestBuildUpdateDocumentStyleRequest_ZeroMarginAllowed'go test ./internal/cmd -run 'TestParseMarkdown_EmptyHeader|TestNormalizeMarkdownTables|TestDocsWrite_MarkdownReplace|TestDocsPageLayoutCmd|TestDocsWrite_PageSize|TestDocsWriteUpdate_Pageless'make ci./bin/gog docs write doc1 --text hello --page-width 8.5in --margin-left 0.5in --margin-right 0.5in --dry-run --json./bin/gog docs page-layout doc1 --page-width 960 --dry-run --json./bin/gog docs page-layout doc1 --layout pages --page-width 960 --dry-run --json./bin/gog auth list --check --json --no-inputconfirms live Google Docs testing is blocked by missingGOG_KEYRING_PASSWORDfor the file keyring in this shell./Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode local --prompt ...-> clean, no accepted/actionable findings.