Skip to content

feat: auto-generated type tables, named RenderFragment slots, sitemap / robots / og meta - #25

Merged
Shewart merged 4 commits into
mainfrom
feat/auto-typetable-named-slots-sitemap
Aug 29, 2026
Merged

feat: auto-generated type tables, named RenderFragment slots, sitemap / robots / og meta#25
Shewart merged 4 commits into
mainfrom
feat/auto-typetable-named-slots-sitemap

Conversation

@Shewart

@Shewart Shewart commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Three authoring / SEO features that stack together to make writing per-component docs and shipping a public site substantially less manual.

  1. <AutoTypeTable Component="Name" /> — replaces the hand-copied <TypeRow> per prop with a reflection-driven prop table.
  2. Named RenderFragment slots in razor:preview and inline component tags — unblocks previewing composed components (Alert with Icon, Card with Header, Sheet, Drawer, Tabs, Accordion).
  3. shelldocs build --site-url — emits sitemap.xml + robots.txt + per-page og:* meta tags, so a deployed site is properly indexed and shareable.

What's in

Added

  • <AutoTypeTable Component="Name" /> primitive. Renders a full props table for any registered component by reflecting on its [Parameter] properties:

    • Type — compact C#-ish rendering (string?, RenderFragment?, IReadOnlyDictionary<string, object>?)
    • Default — from [DefaultValue], or from instantiating the component and reading the property (skips null, string.Empty, and RenderFragment defaults as em-dash)
    • Required[EditorRequired]
    • Description — XML doc <summary> on the property, loaded from the sidecar <Assembly>.xml next to the DLL

    Every existing per-primitive doc page's hand-maintained <TypeTable> becomes one line. <TypeTable> / <TypeRow> stay for cases where hand curation is preferable (custom category columns, cross-cutting docs).

  • Named RenderFragment slots in child content. SlotRenderer.BuildParameters now inspects the target's [Parameter] props for RenderFragment types (other than ChildContent) and routes matching child tags into those params. Authors can finally write:

    <Alert Title="Heads up">
      <Icon><svg>…</svg></Icon>
      Body text.
      <Footer>Small print.</Footer>
    </Alert>

    and have <Icon> render into Alert.Icon, <Footer> into Alert.Footer, and the leftover text into Alert.ChildContent. Backwards compatible — pages without named-slot tags in child content are unaffected.

  • shelldocs build --site-url <https://example.com> flag. When set, BuildCommand emits:

    • sitemap.xml — well-formed urlset with every prerendered URL (visible + hidden), deduplicated
    • robots.txt — allows all, points at the sitemap
    • og:type / og:url / og:title / og:description meta tags injected before </head> on each prerendered page, sourced from the nav-graph node's title + description

    All three are silently skipped when --site-url is unset — no broken sitemaps in local builds.

  • ShellDocsOptions.SiteUrl — declared symmetrically with the CLI flag for consumers who prefer configuration-side declaration. Currently informational; the CLI flag is the mechanism shelldocs build consumes.

  • XmlDocIndex — internal, per-assembly XML doc cache. Loads <Assembly>.xml sidecar once per assembly (via ConcurrentDictionary), exposes summaries by member id. Missing sidecar → em-dash description. Feeds AutoTypeTable.

Changed

  • SlotRenderer.BuildParameters — one additional pass over the target's [Parameter] props to compute the named-slot set before falling through to the pre-fix ChildContent-only behavior. Adds ExtractNamedSlot helper for balanced tag extraction. No behavior change for components without RenderFragment params, or for child content that doesn't contain a matching named-slot tag.

Files

New — 3:

  • src/ShellDocs.Components/Content/AutoTypeTable.razor
  • src/ShellDocs.Components/Content/XmlDocIndex.cs
  • tests/ShellDocs.Tests/SlotRendererTests.cs

Modified — 7:

  • src/ShellDocs.CLI/Commands/BuildCommand.cssiteUrl param + three SEO helpers
  • src/ShellDocs.CLI/Program.cs--site-url option wired into build
  • src/ShellDocs.Components/Content/SlotRenderer.cs — named-slot routing
  • src/ShellDocs.Components/ShellDocsOptions.csSiteUrl property
  • tests/ShellDocs.Tests/BuildCommandTests.cs — 6 new tests for sitemap / robots / og meta
  • CHANGELOG.md[0.1.6-alpha] section
  • Directory.Build.props0.1.5-alpha0.1.6-alpha

Copilot AI lite review requested due to automatic review settings August 29, 2026 17:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Shewart
Shewart merged commit 27fd3e2 into main Aug 29, 2026
1 check passed
@Shewart
Shewart deleted the feat/auto-typetable-named-slots-sitemap branch August 29, 2026 17:22
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