Skip to content

No markdown → terminal/ANSI renderer (markdown/to-ansi) #93

Description

@HelgeSverre

What's missing

No markdown → terminal/ANSI renderer. Sema has markdown/to-html and the
structured markdown/headings / markdown/frontmatter, but nothing that
renders CommonMark to styled terminal text (headings, bold/italic, inline code,
fenced code blocks, bullet/numbered lists). Every terminal LLM app needs this —
agent replies are markdown — so each one re-implements a parser.

Minimal reproduction (sema 1.30.0)

$ sema -e '(markdown/to-ansi "# Hi")'
Error: Unbound variable: markdown/to-ansi

$ sema -e '(term/markdown "# Hi")'
Error: Unbound variable: term/markdown

Only the HTML/structured markdown fns are registered
(crates/sema-stdlib/src/markup.rs): markdown/to-html, markdown/headings,
markdown/frontmatter.

Why it matters

examples/sema-coder renders agent replies to the terminal and has to
special-case markdown by hand. Suggested direction: a markdown/to-ansi /
term/markdown builtin (width-aware, theme-able) reusing the pulldown-cmark
parser already vendored for markdown/to-html.

Surfaced while hardening examples/sema-coder.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions