Files
kebab/tasks/p9/p9-fb-11-ask-markdown-render.md
altair823 a757e2cdb3 review(회차1): 회차 1 지적 5건 반영
- p9-dogfooding-feedback.md item 14: README 오타 (READE → README)
- p9-fb-11.md frontmatter: depends_on=[p9-fb-14] 추가 (14.unblocks 와 양방향 정합)
- p9-fb-01.md Behavior contract: '14 번과 wiring' 모호 cross-ref 정정 — cancel wiring 은 p9-fb-04, TUI 신호는 p9-fb-03
- plan File Structure: 'tasks/HOTFIXES.md — n/a (skip)' 자기모순 제거 → 별도 HOTFIXES 절로 분리
- plan task 4 handler: let _ = data_only; 제거, pattern binding 자체를 data_only: _ 로 변경 (관용적)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:01:14 +00:00

2.0 KiB

phase, component, task_id, title, status, depends_on, unblocks, contract_source, contract_sections, source_feedback
phase component task_id title status depends_on unblocks contract_source contract_sections source_feedback
P9 kebab-tui (ask pane) p9-fb-11 Ask answer markdown rendering (bold/italic/code/list/table) planned
p9-fb-14
../../docs/superpowers/specs/2026-04-27-kebab-final-form-design.md
§7 RAG
§10 UX
p9-dogfooding-feedback.md item 9

p9-fb-11 — Ask markdown render

Goal

ask 답변의 markdown 문법을 ratatui Span / Line 으로 변환해 시각 구분. raw **bold** 사라지고 실제 bold 표시.

Allowed dependencies

  • pulldown-cmark (이미 워크스페이스에 있음).
  • ratatui (기존).

Public surface

kebab-tui::markdown::render(text: &str, theme: &Theme) -> Vec<Line<'static>>. theme 은 p9-fb-14.

Behavior contract

inline:

  • **bold** / __bold__Modifier::BOLD.
  • *italic* / _italic_Modifier::ITALIC.
  • inline code ` → bg theme.code_bg.
  • 링크 [text](url) → underline + theme.link.

block:

  • heading #, ##, ... → fg color 에 따라 hierarchy.
  • list bullet - / * / 1. → indent + bullet char.
  • code fence → 박스 widget + monospace assumed.
  • table | col | → ratatui Table widget. column auto-width.
  • blockquote > → 좌측 vertical bar + dim fg.

streaming 처리: 마지막 incomplete inline span (e.g. 닫지 않은 **) 은 raw 로 표시. complete 부분만 styled. 매 frame 재 parse — cheap, ms 단위.

Test plan

kind description
unit **hi** → 1 Span with BOLD modifier
unit code fence → CodeBlock 변환
unit table 2x2 → ratatui Table
snapshot 복합 답변 (heading + list + code) → snapshot 비교

DoD

  • cargo test -p kebab-tui 통과
  • 도그푸딩: bold / italic / table 답변 정상 렌더
  • CLI ask 출력은 raw markdown 유지 (terminal 호환성)

Out of scope

  • 이미지 (markdown img tag) 렌더링 — 터미널 한계
  • 링크 클릭 / 따라가기 (P+)