Skip to content

Improve documentation visuals for web rendering#7

Merged
JamestsaiTW merged 1 commit into
mainfrom
website
Jun 13, 2026
Merged

Improve documentation visuals for web rendering#7
JamestsaiTW merged 1 commit into
mainfrom
website

Conversation

@JamestsaiTW

Copy link
Copy Markdown
Owner

Why

Several documentation diagrams rendered acceptably in Markdown source but broke down on the published site, especially in zh-TW pages where proportional fonts and mixed-width text made ASCII layouts drift out of alignment. This updates those visuals so the browser rendering is stable and easier to review.

What changed

  • Replaced the token context ASCII diagram with a reusable HTML/CSS component that keeps input and output sections aligned in both English and zh-TW.
  • Added shared guide-visual styles for card, formula, curve, and step-flow layouts so the site can render these sections consistently without relying on monospaced box drawing.
  • Rolled the same approach through the MCP multiplication example, diminishing-returns chart, and Agent Mode loop sections.
  • Filled in the corresponding zh-TW visuals where the English version already had a diagram-like section, so both languages now present the same structure.

Notes for reviewers

  • The main change is presentation, not content: the text and numbers remain the same, but the visuals now use semantic HTML plus CSS instead of fragile text blocks.
  • The Agent Mode cards also received additional browser-side alignment tuning so the step headers wrap cleanly and the bullet lists sit on the intended left edge in the rendered page.
  • I verified this through the generated site output, not just the Markdown source, because mkdocs serve was intermittently stale during iteration on Windows.

Replace fragile ASCII-style documentation visuals with reusable HTML/CSS components across the token context, MCP cost, savings curve, and agent loop sections. Align the zh-TW and English pages so the rendered site stays consistent and the step cards read cleanly in the browser.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 13, 2026 15:39
@JamestsaiTW JamestsaiTW merged commit e6def42 into main Jun 13, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Doc visuals switch ASCII → semantic HTML + shared CSS components, fix browser rendering drift (esp zh-TW proportional fonts). Adds reusable token-context-diagram + guide-visual layouts, then rewires multiple pages to use them.

Changes:

  • Add token-context-diagram + guide-visual component styles in docs/stylesheets/extra.css.
  • Replace ASCII diagrams with HTML structure in EN pages (context window, MCP tool cost multiplication, savings/risk curve, Agent Mode loop).
  • Add matching zh-TW HTML visuals for same sections.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
docs/stylesheets/extra.css Add shared CSS for new HTML visual components + responsive behavior.
docs/01-why-tokens-matter.md Replace context window ASCII diagram with token-context-diagram HTML.
docs/01-why-tokens-matter.zh-TW.md Same replacement for zh-TW page.
docs/08-mcp-tool-costs.md Replace multiplication ASCII block with guide-visual formula/cards layout.
docs/08-mcp-tool-costs.zh-TW.md Same replacement for zh-TW page.
docs/09-comparisons-data.md Replace diminishing-returns ASCII chart with guide-visual curve bars.
docs/09-comparisons-data.zh-TW.md Same replacement for zh-TW page.
docs/10-practical-setup.md Replace Agent Mode loop ASCII block with guide-visual step cards.
docs/10-practical-setup.zh-TW.md Same replacement for zh-TW page.

│ └──────────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────┘
```
<div class="token-context-diagram" role="img" aria-label="Context window containing input tokens and output tokens">
│ └──────────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────┘
```
<div class="token-context-diagram" role="img" aria-label="Context window containing input tokens and output tokens">
Comment thread docs/08-mcp-tool-costs.md

10,000 tokens × 15 steps = 150,000 tokens just for tool definitions.
```
<div class="guide-visual" role="img" aria-label="Tool definition cost multiplies across servers, tools, and agent steps">
Agent mode 走 15 steps:
10,000 × 15 = 150,000 tokens
```
<div class="guide-visual" role="img" aria-label="工具定義成本會隨 server、tool 與 agent 步數相乘">
Token Savings →
lite full ultra extreme
```
<div class="guide-visual" role="img" aria-label="Compression savings versus quality risk curve">
Comment thread docs/08-mcp-tool-costs.md
</section>
<section class="guide-visual__card">
<h4>Heavy setup example</h4>
<p class="guide-visual__math">10 MCP servers x 5 tools x 200 tokens = 10,000 tokens</p>
Comment thread docs/08-mcp-tool-costs.md
<h4>Heavy setup example</h4>
<p class="guide-visual__math">10 MCP servers x 5 tools x 200 tokens = 10,000 tokens</p>
<div class="guide-visual__flow">
<p class="guide-visual__math">10,000 tokens x 15 steps</p>
<div class="guide-visual__grid guide-visual__grid--2">
<section class="guide-visual__card">
<h4>公式</h4>
<p class="guide-visual__math">Tools loaded = servers x tools_per_server x tokens_per_tool</p>
</section>
<section class="guide-visual__card">
<h4>重度設定範例</h4>
<p class="guide-visual__math">10 MCP servers x 5 tools x 200 tokens = 10,000 tokens</p>
<h4>重度設定範例</h4>
<p class="guide-visual__math">10 MCP servers x 5 tools x 200 tokens = 10,000 tokens</p>
<div class="guide-visual__flow">
<p class="guide-visual__math">10,000 tokens x 15 steps</p>
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.

2 participants