Skip to content

Add extensible LLMS Markdown serializers for custom MDX/JSX components #134

@LadyBluenotes

Description

@LadyBluenotes

Summary

SolidBase currently generates LLMS/document-markdown output by converting route content into Markdown-oriented text, but custom MDX/JSX components cannot be serialized with guaranteed semantics.

We can normalize built-in wrappers, but user-defined JSX components are still ambiguous without an explicit conversion.

Goal

Add an extension that lets users define how custom MDX/JSX components should be converted into plain Markdown for LLMS export.

Proposed Direction

Add an LLMS/document-markdown serializer registry, for example under config:

llms: {
  componentSerializers: {
    Callout(node, ctx) {
      // return mdast nodes or markdown text
    },
    ApiTable(node, ctx) {
      // custom conversion
    },
  },
  unknownComponentBehavior: "flatten" | "warn" | "error" | "drop",
}

Requirements

  • guarantee plain Markdown output for LLMS artifacts
  • allow user-defined serializers for custom JSX components
  • provide a configurable fallback for unknown components
  • support a strict mode that fails generation on unknown JSX
  • keep output deterministic and testable

Acceptance Criteria

  • custom JSX components can be serialized through config without patching library internals
  • unknown JSX does not silently leak raw MDX into .md LLMS output
  • strict mode can fail generation when unsupported JSX is encountered
  • docs explain serializer behavior, fallback modes, and strict mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions