diff --git a/Cordial-Tables.md b/Cordial-Tables.md index 7c539e5..6379b9f 100644 --- a/Cordial-Tables.md +++ b/Cordial-Tables.md @@ -1,89 +1,91 @@ -# Cordial Tables - -## Insert a table - -**Cmd+T** at the cursor: - -```markdown -| Header 1 | Header 2 | Header 3 | -| -------- | -------- | -------- | -| | | | -``` - -## Gestures - -| Gesture | Action | -| ------- | ------ | -| Click | Select cell | -| Double-click | Enter edit mode | -| Tab / Enter | Navigate while editing | -| Esc | Leave edit mode | -| Cmd / Shift / Cmd+Shift + click | Toggle / Add / Remove in multi-cell selection | -| Drag | Rectangular selection | -| Corner cell click | Whole-table select | -| Right-click | Context menu | -| Column header edge | Column resize | -| Double-click a divider | Auto-fit | - -## Cell formulas - -``` -| Item | Cost | Tax (8%) | -| ------- | ----- | ------------ | -| Coffee | 4 | /= B2 * 0.08 | -| Bagel | 3 | /= B3 * 0.08 | -``` - -Bare `A1`-style identifiers inside a formula resolve to the same table. - -## Naming a table - -```markdown -### Budget - -| Category | Amount | -| -------- | ------ | -| Rent | 1500 | -| Food | 600 | -``` - -```cordial -/= sum(@Budget:B2:B3) // → 2100 -``` - -H3 → global; H4 → module-local. - -## Cell references from text blocks - -```cordial -@Budget // whole table → 2D array -@Budget:A1 // single cell -@Budget:A2:B5 // rectangular range -@Budget[A2:B5] // alternative range syntax -@Calculations::Revenue:B1 // cross-block -``` - -## Mutation - -```cordial -@Budget:C2 = "subtotal" -@Budget:C3 = sum(@Budget:B2:B5) -``` - -Statement-form only. - -## Persistence - -Markdown is the source of truth. Rich metadata — column widths, row heights, cell formulas — round-trips through a base64-encoded ZIP appended to the file inside an HTML comment: - -``` - -``` - -## See also - -- [Cordial Reference](Cordial-Reference) -- [Cordial Modules](Cordial-Modules) -- [Keyboard Reference](Keyboard-Reference) +# Cordial Tables + +## Insert a table + +**Cmd+T** at the cursor: + +```markdown +| Header 1 | Header 2 | Header 3 | +| -------- | -------- | -------- | +| | | | +``` + +## Gestures + +| Gesture | Action | +| ------- | ------ | +| Click | Select cell | +| Double-click | Enter edit mode | +| Tab / Enter | Navigate while editing | +| Esc | Leave edit mode | +| Cmd / Shift / Cmd+Shift + click | Toggle / Add / Remove in multi-cell selection | +| Drag | Rectangular selection | +| Corner cell click | Whole-table select | +| Right-click | Context menu | +| Column header edge | Column resize | +| Double-click a divider | Auto-fit | + +## Cell formulas + +``` +| Item | Cost | Tax (8%) | +| ------- | ----- | ------------ | +| Coffee | 4 | /= B2 * 0.08 | +| Bagel | 3 | /= B3 * 0.08 | +``` + +Bare `A1`-style identifiers inside a formula resolve to the same table. + +## Naming a table + +```markdown +### Budget + +| Category | Amount | +| -------- | ------ | +| Rent | 1500 | +| Food | 600 | +``` + +```cordial +/= sum(@Budget:B2:B3) // → 2100 +``` + +H3 → global; H4 → module-local. + +## Cell references from text blocks + +```cordial +@Budget // whole table → 2D array +@Budget:A1 // single cell +@Budget:A2:B5 // rectangular range +@Budget[A2:B5] // alternative range syntax +@Calculations::Revenue:B1 // cross-block +``` + +## Mutation + +```cordial +@Budget:C2 = "subtotal" +@Budget:C3 = sum(@Budget:B2:B5) +``` + +Statement-form only. + +## Persistence + +Markdown is always maintained as the front-facing document content. But the actual file has a lot more in it, it carries metadata, positional information, graphics properties, etc. Feel free to inspect it, it's base64 binary data; A zip file appended to the end of the markdown document. Invisible to a standard text editor, so it's still editable and sharable externally without losing the depth of information Acord keeps or breaking compatibility with external markdown editors/renderers. There's enough custom file extension formats out there already. No need for a new one for this. + +``` + +``` + +Is how it will look if you inspect the raw file. If you are curious (and it's kinda neat!) check out one of the notes with Hex Fiend or another simnilar program ;D + +## See also + +- [Cordial Reference](Cordial-Reference) +- [Cordial Modules](Cordial-Modules) +- [Keyboard Reference](Keyboard-Reference)