feat: auto-generated type tables, named RenderFragment slots, sitemap / robots / og meta - #25
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three authoring / SEO features that stack together to make writing per-component docs and shipping a public site substantially less manual.
<AutoTypeTable Component="Name" />— replaces the hand-copied<TypeRow>per prop with a reflection-driven prop table.RenderFragmentslots inrazor:previewand inline component tags — unblocks previewing composed components (Alert with Icon, Card with Header, Sheet, Drawer, Tabs, Accordion).shelldocs build --site-url— emitssitemap.xml+robots.txt+ per-pageog:*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:string?,RenderFragment?,IReadOnlyDictionary<string, object>?)[DefaultValue], or from instantiating the component and reading the property (skipsnull,string.Empty, andRenderFragmentdefaults as em-dash)[EditorRequired]<summary>on the property, loaded from the sidecar<Assembly>.xmlnext to the DLLEvery 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
RenderFragmentslots in child content.SlotRenderer.BuildParametersnow inspects the target's[Parameter]props forRenderFragmenttypes (other thanChildContent) and routes matching child tags into those params. Authors can finally write:and have
<Icon>render intoAlert.Icon,<Footer>intoAlert.Footer, and the leftover text intoAlert.ChildContent. Backwards compatible — pages without named-slot tags in child content are unaffected.shelldocs build --site-url <https://example.com>flag. When set,BuildCommandemits:sitemap.xml— well-formed urlset with every prerendered URL (visible + hidden), deduplicatedrobots.txt— allows all, points at the sitemapog:type/og:url/og:title/og:descriptionmeta tags injected before</head>on each prerendered page, sourced from the nav-graph node's title + descriptionAll three are silently skipped when
--site-urlis 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 mechanismshelldocs buildconsumes.XmlDocIndex— internal, per-assembly XML doc cache. Loads<Assembly>.xmlsidecar once per assembly (viaConcurrentDictionary), exposes summaries by member id. Missing sidecar → em-dash description. FeedsAutoTypeTable.Changed
SlotRenderer.BuildParameters— one additional pass over the target's[Parameter]props to compute the named-slot set before falling through to the pre-fixChildContent-only behavior. AddsExtractNamedSlothelper 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.razorsrc/ShellDocs.Components/Content/XmlDocIndex.cstests/ShellDocs.Tests/SlotRendererTests.csModified — 7:
src/ShellDocs.CLI/Commands/BuildCommand.cs—siteUrlparam + three SEO helperssrc/ShellDocs.CLI/Program.cs—--site-urloption wired intobuildsrc/ShellDocs.Components/Content/SlotRenderer.cs— named-slot routingsrc/ShellDocs.Components/ShellDocsOptions.cs—SiteUrlpropertytests/ShellDocs.Tests/BuildCommandTests.cs— 6 new tests for sitemap / robots / og metaCHANGELOG.md—[0.1.6-alpha]sectionDirectory.Build.props—0.1.5-alpha→0.1.6-alpha