Skip to content

Render authored help as Markdown - #223

Merged
raiseCatError merged 1 commit into
feature/172-motion-enginefrom
feature/168-authored-markdown
Sep 30, 2026
Merged

raiseCatError merged 1 commit into
feature/172-motion-enginefrom
feature/168-authored-markdown

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Implements #168.

Stacked on #222 (feature/172-motion-engine). Merge order: #203, #217, #218, #219, #220, #221, #222, then this PR.

What changed

  • src/help/markdown.ts: renders NMSh-authored Markdown into wrapped, styled rows. It supports headings, lists (bulleted and numbered), bold, italic, inline code, fenced code, tables and links. Tables fall back to labelled rows when too narrow. Links use OSC 8 only where supported (NMSH_HYPERLINKS=1|0 overrides detection) and otherwise read text (url). Only http(s) URLs are linked, and control characters are stripped from the source.
  • Colors come from Chroma roles, so NO_COLOR gives a plain path; inline code stays visible with backticks there.
  • src/help/helpContent.ts builds the /help page from the real slash-command table plus the existing tips. /help now renders through the new renderer with the same information as before.

Safety boundary

  • The renderer only accepts a branded AuthoredMarkdown value, created by authoredMarkdown(). A plain string, such as shell output, does not type-check.
  • A test pins the modules allowed to import the renderer, and asserts that TerminalApp calls it exactly once, for /help. Shell output, PTY streams, transcript output, /copy and archives never pass through it.

Not included

  • /help writes into the transcript, whose cell model drops OSC 8, so /help renders links in the plain form. The renderer supports OSC 8 for surfaces written directly.
  • No new consumers (setup guidance, provider docs, release notes, inspector) were wired up; they can adopt it later.

Verification

tests/authoredMarkdown.test.ts; full suite 667/667, typecheck, build and git diff --check clean.

@raiseCatError
raiseCatError added this pull request to stack #228 September 29, 2026 22:29
@raiseCatError
raiseCatError merged commit 30f0b30 into dev Sep 30, 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