From 2a21eca3f26f4ea73f0f5fc9bfa12b08ff07f959 Mon Sep 17 00:00:00 2001 From: Shephard Tseisi Date: Wed, 22 Jul 2026 23:43:55 +0200 Subject: [PATCH 1/7] feat: enhance ShellDocs with new content and API reference primitives, including improved component registration and authoring templates --- docs/ROADMAP.md | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index eb17c7d..656851d 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -164,22 +164,46 @@ Ships to `ShellDocs.Components`. - `PrevNextNav` — auto-derived from nav graph adjacency, rendered at page bottom - `DocsBreadcrumb` — composes ShellUI's `` with docs presets -### `feat/content-primitives` +### ✅ `feat/content-primitives` — shipped Ships to `ShellDocs.Components`. -- `DocsTabs` — multi-tab code containers (`npm` / `yarn` / `pnpm` / `standalone` / `bash` presets) -- `Callout` — Info / Warning / Tip / Danger box (may reuse ShellUI `` with docs styling wrapper) -- `LinkCard` — card-shaped link with title / description / icon for "Next steps" grids -- `FileTree` — static folder / file visualization -- `Steps` — vertical numbered steps for onboarding flows +- `` / `` — multi-tab code containers with cross-page `SyncKey` sync (`npm` / `pnpm` / `yarn`, etc.) +- `` (Info / Warning / Danger / Tip) with per-variant icon +- `` / `` / `` — responsive card grid + anchor-shaped link card +- `` / `` — recursive project-layout diagram with `IsFolder`, `Highlight`, `Comment` +- `` / `` — CSS-counter numbered ordered list with a badge-on-rail spine +- Preview-frame overhaul: dropped tabs for a fumadocs-style stacked preview + collapsed code teaser with "View Code" expand — both panels stay mounted, killing the whole class of tab-switch state loss +- `SlotRenderer` gains recursive nested-markup rendering (`ChildContentRaw` threading, `Dedent` for Markdig 4-space-indent trap) and per-property type coercion for `bool` / `int` / enum attribute values -### `feat/api-reference-primitives` +### ✅ `feat/api-reference-primitives` — shipped Ships to `ShellDocs.Components`. -- `TypeTable` — props table with `` child components -- `ComponentPreview` — live component render by name + prop dictionary, source-view toggle -- Uses `` for runtime component rendering -- Type registry from `ShellDocs.Markdown` reused +- `` / `` — hand-authored props reference table via `CascadingValue` registration +- `` — declarative-prop cousin of `razor:preview`; resolves target by name through `TypeRegistry`, forwards attrs via `CaptureUnmatchedValues` with the same per-type coercion `SlotRenderer` uses, reconstructs source view from the resolved prop dict (self-closing form when no body) +- `SlotRenderer.Coerce` + `GetParameterProps` bumped to `internal` so `ComponentPreview` can drive the same conversion path + +### ✅ `feat/consumer-registration-dx` — shipped +Ships to `ShellDocs.Components` + `ShellDocs.Templates` + `ShellDocs.CLI` + `ShellDocs.Markdown`. + +**Registration (`ShellDocs.Components`)** +- `ShellDocsOptions.RegisterComponentsFromAssembly()` — assembly-scan overload that walks the marker's assembly for public, concrete, non-generic `ComponentBase` subclasses and registers each. Kills the "hand-type `RegisterComponent()` for every ShellUI component" tax for consumers. +- `RegisterComponentsFromAssembly(Assembly, Func?)` — explicit form with a filter predicate for finer control (namespace narrowing, opt-in subsets, etc.) +- `[ShellDocsIgnore]` attribute — opt-out marker for public components that shouldn't be reachable from markdown authoring (e.g. render-machinery components that live in the same assembly) +- `RegisterComponent(Type)` runtime overload alongside the existing generic form +- `RegisterComponent(string tagName)` + `RegisterComponent(Type, string tagName)` — alias overloads that expose a component under a different markdown-facing tag (e.g. `` for `ShellUI.Button`); backed by a per-type `ComponentAliases` dictionary that `BuildTypeRegistry` consults before falling back to `type.Name` +- **Dogfooded on ourselves:** `AddShellDocs` now scans `ShellDocs.Components.Content` via this API instead of the old explicit-list `RegisterComponent(); .RegisterComponent(); …` block, so a new primitive dropped under `Content/` auto-appears without a maintainer edit to `ServiceCollectionExtensions.cs`. `MarkdownContent` and `PreviewFrame` opt out via `[ShellDocsIgnore]`. + +**Content scaffolding (`ShellDocs.Templates` + `ShellDocs.CLI`)** +- `shelldocs add