Skip to content

feat(docs): add --spacing-mode flag to docs format for paragraph spacing control #885

Description

@odyssey4me

What I'm trying to do

Control the spacingMode property on paragraph styles after importing markdown via gog docs write --markdown. Specifically, set NEVER_COLLAPSE on bullet list paragraphs so that spaceBelow is always honoured between consecutive list items — the default COLLAPSE_LISTS causes Google Docs to collapse spacing, making multi-line bullet items feel cramped.

Gap (confirmed in CLI, v0.31.0)

gog docs format --help exposes --space-above, --space-below, and --line-spacing but has no flag for spacingMode. There is no other gog command that sets this property. The only way to change it today is a raw updateParagraphStyle API call outside of gog.

Why this is feasible (Docs API)

The Docs REST API updateParagraphStyle request supports spacingMode as a field on ParagraphStyle. Valid values are NEVER_COLLAPSE and COLLAPSE_LISTS. Ref: https://developers.google.com/docs/api/reference/rest/v1/documents#SpacingMode

gog docs format already builds updateParagraphStyle requests for other paragraph properties (lineSpacing, spaceAbove, spaceBelow, alignment). Adding spacingMode is the same pattern — one additional field.

Proposed surface

A --spacing-mode flag on gog docs format:

gog docs format <docId> --spacing-mode NEVER_COLLAPSE

Accepted values: NEVER_COLLAPSE, COLLAPSE_LISTS.

Composes with existing flags:

# Set on a specific paragraph by text match
gog docs format <docId> --match "bullet text" --spacing-mode NEVER_COLLAPSE

# Combine with other paragraph formatting
gog docs format <docId> --spacing-mode NEVER_COLLAPSE --space-below 8

Should also work with --batch for batched requests.

Use case

Round-trip markdown-to-Docs workflows. After gog docs write --markdown, bullet lists default to COLLAPSE_LISTS which visually collapses spacing. Setting NEVER_COLLAPSE restores consistent readability without requiring raw API calls.

Version

v0.31.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions