Skip to content

feat(docs): add --code flag to docs format for monospace + grey background #685

@sebsnyk

Description

@sebsnyk

Motivation

gog already implements "code-styled run" — inline backticks in markdown render as Courier New + grey background (internal/cmd/docs_formatter.go), and gog docs sed 's/X/{#}X/' does the same (internal/cmd/docs_sed_brace_format.go). The same single semantic unit is not reachable from gog docs format.

Repro

gog docs format <DOC_ID> --match "ImportantClass" --font-family "Courier New" --bg-color "#EEEEEE"
# Works but is two flags and the user has to know the exact font + colour. Inconsistent with sed.

Proposed surface

gog docs format <docId> --match <text> --code [--match-all]

Behaviour: sets weightedFontFamily=Courier New (matching the existing markdown converter) plus the existing grey background in one UpdateTextStyle request. Mutually exclusive with --font-family and --bg-color to avoid surprise.

Acceptance criteria

  • --code produces the same visual output as a markdown backtick run pushed via gog docs write --markdown.
  • One batchUpdate request, identical to what gog docs sed '{#}' emits today.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions