|
| 1 | +# ASCII Diagram Standards |
| 2 | + |
| 3 | +## MANDATORY: Use Basic ASCII Only |
| 4 | + |
| 5 | +**CRITICAL**: ALWAYS use basic ASCII characters for diagrams (maximum compatibility). |
| 6 | + |
| 7 | +### ✅ ALLOWED: `+` `-` `|` `^` `v` `<` `>` and alphanumeric text |
| 8 | + |
| 9 | +### ❌ FORBIDDEN: Unicode box-drawing characters |
| 10 | +- NO: `┌` `─` `│` `└` `┐` `┘` `├` `┤` `┬` `┴` `┼` `▼` `▲` `►` `◄` |
| 11 | +- Reason: Inconsistent rendering across fonts/platforms |
| 12 | + |
| 13 | +## Standard ASCII Diagram Patterns |
| 14 | + |
| 15 | +### CRITICAL: Character Width Rule |
| 16 | +**Every line in a box MUST have EXACTLY the same character count (including spaces)** |
| 17 | + |
| 18 | +✅ CORRECT (all lines = 67 chars): |
| 19 | +``` |
| 20 | ++---------------------------------------------------------------+ |
| 21 | +| Component Name | |
| 22 | +| Description text here | |
| 23 | ++---------------------------------------------------------------+ |
| 24 | +``` |
| 25 | + |
| 26 | +❌ WRONG (inconsistent widths): |
| 27 | +``` |
| 28 | ++---------------------------------------------------------------+ |
| 29 | +| Component Name | |
| 30 | +| Description text here | |
| 31 | ++---------------------------------------------------------------+ |
| 32 | +``` |
| 33 | + |
| 34 | +### Box Pattern |
| 35 | +``` |
| 36 | ++-----------------------------------------------------+ |
| 37 | +| | |
| 38 | +| Calculator Application | |
| 39 | +| | |
| 40 | +| Provides basic arithmetic operations for users | |
| 41 | +| through a web-based interface | |
| 42 | +| | |
| 43 | ++-----------------------------------------------------+ |
| 44 | +``` |
| 45 | + |
| 46 | +### Nested Boxes |
| 47 | +``` |
| 48 | ++-------------------------------------------------------+ |
| 49 | +| Web Server (PHP Runtime) | |
| 50 | +| +-------------------------------------------------+ | |
| 51 | +| | index.php (Monolithic Application) | | |
| 52 | +| | +-------------------------------------------+ | | |
| 53 | +| | | HTML Template (View Layer) | | | |
| 54 | +| | | - Form rendering | | | |
| 55 | +| | | - Result display | | | |
| 56 | +| | +-------------------------------------------+ | | |
| 57 | +| +-------------------------------------------------+ | |
| 58 | ++-------------------------------------------------------+ |
| 59 | +``` |
| 60 | + |
| 61 | +### Arrows and Connections |
| 62 | +``` |
| 63 | ++----------+ |
| 64 | +| Source | |
| 65 | ++----------+ |
| 66 | + | |
| 67 | + | HTTP POST |
| 68 | + v |
| 69 | ++----------+ |
| 70 | +| Target | |
| 71 | ++----------+ |
| 72 | +``` |
| 73 | + |
| 74 | +### Horizontal Flow |
| 75 | +``` |
| 76 | ++-------+ +-------+ +-------+ |
| 77 | +| Step1 | --> | Step2 | --> | Step3 | |
| 78 | ++-------+ +-------+ +-------+ |
| 79 | +``` |
| 80 | + |
| 81 | +### Vertical Flow with Labels |
| 82 | +``` |
| 83 | +User Action Flow: |
| 84 | + | |
| 85 | + v |
| 86 | ++----------+ |
| 87 | +| Input | |
| 88 | ++----------+ |
| 89 | + | |
| 90 | + | validates |
| 91 | + v |
| 92 | ++----------+ |
| 93 | +| Process | |
| 94 | ++----------+ |
| 95 | + | |
| 96 | + | returns |
| 97 | + v |
| 98 | ++----------+ |
| 99 | +| Output | |
| 100 | ++----------+ |
| 101 | +``` |
| 102 | + |
| 103 | +## Validation |
| 104 | + |
| 105 | +Before creating diagrams: |
| 106 | +- [ ] Basic ASCII only: `+` `-` `|` `^` `v` `<` `>` |
| 107 | +- [ ] No Unicode box-drawing |
| 108 | +- [ ] Spaces (not tabs) for alignment |
| 109 | +- [ ] Corners use `+` |
| 110 | +- [ ] **ALL box lines same character width** (count characters including spaces) |
| 111 | +- [ ] Test: Verify corners align vertically in monospace font |
| 112 | + |
| 113 | +## Alternative |
| 114 | + |
| 115 | +For complex diagrams, use Mermaid (see `content-validation.md`) |
| 116 | + |
0 commit comments