Skip to content

Markdown-flavored sheet format - #5

Merged
antonysastre merged 5 commits into
mainfrom
worktree-markdown-format
May 16, 2026
Merged

antonysastre merged 5 commits into
mainfrom
worktree-markdown-format

Conversation

@antonysastre

@antonysastre antonysastre commented May 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Hard cutover of she's sheet format from command > description / // to a small markdown-flavored grammar:

  • Section headers — any line whose first non-whitespace character is uppercase A–Z (rendered bold cyan).
  • Comments — lines starting with # (free-standing; rendered dim italic).
  • Commands with optional descriptions — text up to the first # is the command; anything after is the description (rendered green + · + italic). The first # always wins, so URL fragments end the command.
  • Blank source lines are now preserved as visual separators between groups instead of being filtered out.

The pager precomputes the longest command in the sheet via a new MaxCommandWidth helper and column-aligns all descriptions; commands sit flush-left (no leading indent). The bespoke ValidateFormat warning block is gone — every line is structurally valid under the new grammar.

Three commits, each compiling and passing tests on its own:

  1. feat(sheet): switch to markdown-flavored sheet format
  2. feat(sheet): honor blank source lines in View
  3. feat(sheet): align descriptions and drop command indent

Existing user sheets in the old format render as plain command lines until ported by hand (no in-tree migration; the user's own sheets were ported separately).

Hard cutover from `command > description` / `//` to a grammar of blanks, `#` comments/descriptions, and capital-letter section headers.
Stop filtering empty lines so authored blank rows render as visible separators. Also trim a trailing newline to avoid a phantom blank.
Commands sit flush-left; descriptions align in one column based on the longest command in the sheet, computed once per file.
Renames the local accumulator in MaxCommandWidth to avoid shadowing Go 1.21's builtin max, and notes that alignment is rune-count-based. Adds a test for source padding combined with a width parameter.
@antonysastre
antonysastre force-pushed the worktree-markdown-format branch from dcc5421 to 58a39fb Compare May 16, 2026 02:22
Prefixes `_, _ =` on every unchecked fmt.Fprint* call in commands.go, pager.go, and sync.go to match the existing convention (visible in sheet.List) and clear the errcheck lint failures blocking PR merges under the new branch ruleset.
@antonysastre
antonysastre merged commit 5d02c14 into main May 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant