Skip to content

Make TypeRenderer format-agnostic#5153

Merged
SeanTAllen merged 1 commit intomainfrom
sean/format-agnostic-type-renderer
Apr 7, 2026
Merged

Make TypeRenderer format-agnostic#5153
SeanTAllen merged 1 commit intomainfrom
sean/format-agnostic-type-renderer

Conversation

@SeanTAllen
Copy link
Copy Markdown
Member

Prerequisite refactor for adding an Info backend to pony-doc. Extracts
MkDocs-specific link formatting from TypeRenderer into a LinkFormat
trait so both the existing MkDocs backend and the upcoming Info backend
can share the same rendering logic.

Replaces generate_links: Bool with (LinkFormat val | None) across
all 6 TypeRenderer methods. _nominal uses a match-with-guard to
combine the format check and linkability check into a single branch.
MkDocsBackend call sites change mechanically: true becomes
MkDocsLinkFormat, false becomes None.

Verified by diffing pony-doc output on the collections stdlib package
before and after — identical output.

Design: #5149

Extract MkDocs-specific link formatting from TypeRenderer into a
LinkFormat trait so multiple documentation backends can share the
rendering logic. This is a prerequisite for adding an Info backend
to pony-doc.

Replace `generate_links: Bool` parameter with `(LinkFormat val | None)`
across all 6 TypeRenderer methods. MkDocsBackend passes
MkDocsLinkFormat where it previously passed true, and None where it
passed false.

Design: #5149
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Apr 7, 2026
@SeanTAllen SeanTAllen merged commit e4faecc into main Apr 7, 2026
14 checks passed
@SeanTAllen SeanTAllen deleted the sean/format-agnostic-type-renderer branch April 7, 2026 03:11
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Apr 7, 2026
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