Skip to content

Commit eefe5d2

Browse files
committed
feat: introduce Packages property and AddPackage method in ShellDocsOptions for enhanced package management
1 parent 458e5fd commit eefe5d2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/ShellDocs.Components/ShellDocsOptions.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public class ShellDocsOptions
1414
public DocsLayoutVariant LayoutVariant { get; set; } = DocsLayoutVariant.TopNav;
1515

1616
public List<NavLink> PrimaryNav { get; } = new();
17+
// 0 or 1 entries hides the sidebar package selector entirely.
18+
public List<DocsPackage> Packages { get; } = new();
1719
public List<Type> RegisteredComponents { get; } = new();
1820
/* Per-type tag alias — when a type appears here, BuildTypeRegistry uses this
1921
string as the markdown-facing tag name instead of the type's short name.
@@ -109,6 +111,12 @@ public ShellDocsOptions AddNavMenu(string label, params NavMenuItem[] items)
109111
return this;
110112
}
111113

114+
public ShellDocsOptions AddPackage(string id, string title, string description, string rootUrl, string? iconPath = null)
115+
{
116+
Packages.Add(new DocsPackage(id, title, description, rootUrl, iconPath));
117+
return this;
118+
}
119+
112120
internal TypeRegistry BuildTypeRegistry()
113121
{
114122
var registry = new TypeRegistry();
@@ -126,6 +134,9 @@ internal TypeRegistry BuildTypeRegistry()
126134
public record NavLink(string Label, string Href, List<NavMenuItem>? Children = null);
127135
public record NavMenuItem(string Label, string Href, string? Description = null, string? IconSvg = null);
128136

137+
// IconPath is a raw SVG `d` attribute value on a 24×24 viewBox — not a URL.
138+
public record DocsPackage(string Id, string Title, string Description, string RootUrl, string? IconPath = null);
139+
129140
public enum ShellDocsTheme
130141
{
131142
Shadcn,

0 commit comments

Comments
 (0)