Skip to content

Commit 53a92d0

Browse files
authored
Enhance Ribbon API docs and add metadata attributes (#1224)
* Enhance metadata and docs for Placeholder components Improve XML docs and add [AddedVersion], [DefaultValue], and [Description] attributes to Placeholder and PlaceholderContainer parameters. Remove redundant remarks and clarify default values. Add [ParameterTypeName] to ChildContent for better tooling and documentation support. * Add Preload Service feature, docs, and navigation - Added Preload Service route constants and screenshot paths for demos and docs - Updated navigation menus to include Preload Service under Services - Added PreloadService documentation page with screenshot and methods table - Enhanced Preload component parameter documentation with version and default value attributes - Documented PreloadService Show/Hide methods with XML comments and attributes - Fixed DemoLink in BreadcrumbService documentation to correct target * Enhance Progress/ProgressBar API docs and metadata Improved XML documentation and added metadata attributes ([AddedVersion], [DefaultValue], [Description], [ParameterTypeName]) to parameters and methods in Progress and ProgressBar components. Updated Label to nullable string. Adjusted documentation sections to better reflect available methods and parameters. These changes improve API clarity and tooling support. * Enhance Ribbon API docs and add metadata attributes Add detailed XML documentation and custom metadata attributes ([AddedVersion], [DefaultValue], [Description], [ParameterTypeName]) to Ribbon, RibbonTab, RibbonGroup, RibbonItem, RibbonItemGroup, and RibbonEventArgs. Update event and parameter docs, make ChildContent nullable and consistent, and improve discoverability in the documentation page. Improves API clarity and self-documentation. * Refactor attribute access, improve type name resolution Refactored PropertyInfoExtenstions to use Attribute.GetCustomAttribute for attribute retrieval, simplifying code. Added NullabilityInfoContext and GetFriendlyTypeName for accurate C# type name generation, including nullable and generic types. Updated GetParameterTypeName to use new logic. Renamed RibbonTab.razor.cs property ChildContent to Content. * Improve property type name display for complex types Enhanced type name rendering in DocxPropertyRow to accurately display tuples, generics, nullable types, and object types. Updated extension methods and constants to ensure C#-idiomatic and user-friendly type names in the UI. * Improve type name display with nullability and generics Refactored method and property type name extraction to use a new GetFriendlyTypeName extension based on NullabilityInfo, ensuring accurate C#-style type names (including nullability, generics, and tuples). Simplified method signature display in DocxMethodRow.razor. Removed legacy type name formatting logic and centralized type name handling in the new NullabilityInfoExtensions.cs. Attribute extraction now uses Attribute.GetCustomAttribute. These changes modernize and unify type name presentation across the documentation/demo UI. * Remove [ParameterTypeName] from Accordion components Removed the [ParameterTypeName] attribute from several parameters in Accordion and AccordionItem classes. Parameters remain unchanged and still use [Parameter], but no longer include explicit type annotations via [ParameterTypeName].
1 parent 546f030 commit 53a92d0

63 files changed

Lines changed: 467 additions & 299 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BlazorBootstrap.Demo.RCL/Components/Layout/DemosMainLayout.razor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ internal override IEnumerable<NavItem> GetNavItems()
9999
new (){ Id = "605", Text = "Scatter Chart", Href = DemoRouteConstants.Demos_URL_ScatterChart, IconName = IconName.GraphUpArrow, ParentId = "6", Match = NavLinkMatch.All },
100100

101101
new(){ Id = "7", Text = "Services", IconName = IconName.WrenchAdjustableCircleFill, IconColor = IconColor.Success },
102-
new (){ Id = "700", Text = "Modal Service", Href = DemoRouteConstants.Demos_URL_ModalService, IconName = IconName.WindowStack, ParentId = "7" },
102+
new (){ Id = "700", Text = "Breadcrumb Service", Href = DemoRouteConstants.Demos_URL_BreadcrumbService, IconName = IconName.SegmentedNav, ParentId = "7" },
103+
new (){ Id = "701", Text = "Modal Service", Href = DemoRouteConstants.Demos_URL_ModalService, IconName = IconName.WindowStack, ParentId = "7" },
104+
new (){ Id = "702", Text = "Preload Service", Href = DemoRouteConstants.Demos_URL_PreloadService, IconName = IconName.ArrowRepeat, ParentId = "7" },
103105

104106
new(){ Id = "19", Text = "Utilities", IconName = IconName.GearWideConnected, IconColor = IconColor.Info },
105107
new (){ Id = "1900", Text = "Color Utility", Href = DemoRouteConstants.Demos_URL_ColorUtils, IconName = IconName.Palette2, ParentId = "19" },

BlazorBootstrap.Demo.RCL/Components/Layout/DocsMainLayout.razor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ internal override IEnumerable<NavItem> GetNavItems()
7575
new (){ Id = "605", Text = "Scatter Chart", Href = DemoRouteConstants.Docs_URL_ScatterChart, IconName = IconName.GraphUpArrow, ParentId = "6", Match = NavLinkMatch.All },
7676

7777
new(){ Id = "7", Text = "Services", IconName = IconName.WrenchAdjustableCircleFill, IconColor = IconColor.Success },
78-
new (){ Id = "700", Text = "Breadcrumb Service", Href = DemoRouteConstants.Docs_URL_BreadcrumbService, IconName = IconName.WindowStack, ParentId = "7" },
78+
new (){ Id = "700", Text = "Breadcrumb Service", Href = DemoRouteConstants.Docs_URL_BreadcrumbService, IconName = IconName.SegmentedNav, ParentId = "7" },
7979
new (){ Id = "701", Text = "Modal Service", Href = DemoRouteConstants.Docs_URL_ModalService, IconName = IconName.WindowStack, ParentId = "7" },
80+
new (){ Id = "702", Text = "Preload Service", Href = DemoRouteConstants.Docs_URL_PreloadService, IconName = IconName.ArrowRepeat, ParentId = "7" },
8081

8182
//new(){ Id = "19", Text = "Utilities", IconName = IconName.GearWideConnected, IconColor = IconColor.Info },
8283
//new (){ Id = "1900", Text = "Color Utility", Href = DemoRouteConstants.Docs_URL_ColorUtils, IconName = IconName.Palette2, ParentId = "19" },

BlazorBootstrap.Demo.RCL/Components/Pages/Docs/ConfirmDialog/ConfirmDialog_Doc_01_Documentation.razor

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<DocxTable TItem="ConfirmDialog" DocType="DocType.Parameters" />
1919
</Section>
2020

21+
<Section Class="p-0" Size="HeadingSize.H3" Name="ConfirmDialog Methods" PageUrl="@pageUrl" Link="confirm-dialog-methods">
22+
<DocxTable TItem="ConfirmDialog" DocType="DocType.Methods" />
23+
</Section>
24+
2125
<Section Class="p-0" Size="HeadingSize.H3" Name="ConfirmDialogOptions Properties" PageUrl="@pageUrl" Link="confirm-dialog-options-properties">
2226
<DocxTable TItem="ConfirmDialogOptions" DocType="DocType.Properties" />
2327
</Section>

BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Progress/Progress_Doc_01_Documentation.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
<DocxTable TItem="Progress" DocType="DocType.Parameters" />
1919
</Section>
2020

21-
<Section Class="p-0" Size="HeadingSize.H3" Name="Progress Methods" PageUrl="@pageUrl" Link="progress-methods">
22-
<DocxTable TItem="Progress" DocType="DocType.Methods" />
23-
</Section>
24-
2521
<Section Class="p-0" Size="HeadingSize.H3" Name="ProgressBar Parameters" PageUrl="@pageUrl" Link="progress-bar-parameters">
2622
<DocxTable TItem="ProgressBar" DocType="DocType.Parameters" />
2723
</Section>
2824

25+
<Section Class="p-0" Size="HeadingSize.H3" Name="ProgressBar Methods" PageUrl="@pageUrl" Link="progress-bar-methods">
26+
<DocxTable TItem="ProgressBar" DocType="DocType.Methods" />
27+
</Section>
28+
2929
@code {
3030
private const string componentName = nameof(Progress);
3131
private const string pageUrl = DemoRouteConstants.Docs_URL_Progress;

BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Ribbon/Ribbon_Doc_01_Documentation.razor

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
<DocxTable TItem="Ribbon" DocType="DocType.Events" />
2727
</Section>
2828

29+
<Section Class="p-0" Size="HeadingSize.H3" Name="RibbonEventArgs Properties" PageUrl="@pageUrl" Link="ribbon-event-args-properties">
30+
<DocxTable TItem="RibbonEventArgs" DocType="DocType.Properties" />
31+
</Section>
32+
2933
<Section Class="p-0" Size="HeadingSize.H3" Name="RibbonTab Parameters" PageUrl="@pageUrl" Link="ribbon-tab-parameters">
3034
<DocxTable TItem="RibbonTab" DocType="DocType.Parameters" />
3135
</Section>

BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Services/BreadcrumbService/BreadcrumbService_Doc_01_Documentation.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
MetaDescription="@metaDescription"
99
ImageUrl="@imageUrl" />
1010

11-
<DemoLink Href="@DemoRouteConstants.Demos_URL_ModalService" />
11+
<DemoLink Href="@DemoRouteConstants.Demos_URL_BreadcrumbService" />
1212

1313
<Section Class="p-0" Size="HeadingSize.H3" Name="Screenshot" PageUrl="@pageUrl" Link="screenshot">
1414
<img src="@imageUrl" class="img-fluid" alt="@metaTitle" />
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@attribute [Route(pageUrl)]
2+
@layout DocsMainLayout
3+
4+
<DocsPageHeadSection PageUrl="@pageUrl"
5+
PageTitle="@pageTitle"
6+
PageDescription="@pageDescription"
7+
MetaTitle="@metaTitle"
8+
MetaDescription="@metaDescription"
9+
ImageUrl="@imageUrl" />
10+
11+
<DemoLink Href="@DemoRouteConstants.Demos_URL_PreloadService" />
12+
13+
<Section Class="p-0" Size="HeadingSize.H3" Name="Screenshot" PageUrl="@pageUrl" Link="screenshot">
14+
<img src="@imageUrl" class="img-fluid" alt="@metaTitle" />
15+
</Section>
16+
17+
<Section Class="p-0" Size="HeadingSize.H3" Name="PreloadService Methods" PageUrl="@pageUrl" Link="preload-service-methods">
18+
<DocxTable TItem="PreloadService" DocType="DocType.Methods" />
19+
</Section>
20+
21+
@code {
22+
private const string componentName = nameof(PreloadService);
23+
private const string pageUrl = DemoRouteConstants.Docs_URL_PreloadService;
24+
private const string pageTitle = componentName;
25+
private const string pageDescription = $"This documentation provides a comprehensive reference for the <code>{componentName}</code> component, guiding you through its configuration options.";
26+
private const string metaTitle = $"Blazor {componentName} Component";
27+
private const string metaDescription = $"This documentation provides a comprehensive reference for the {componentName} component, guiding you through its configuration options.";
28+
private const string imageUrl = DemoScreenshotSrcConstants.Demos_URL_PreloadService;
29+
}

BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxMethodRow.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
@typeparam TItem
44

55
<tr>
6-
<td>@MethodNameWithParameters</td>
7-
<td class="text-danger">@ReturnTypeShortName</td>
6+
<td>@MethodName</td>
7+
<td class="text-danger">@ReturnType</td>
88
<td>@((MarkupString)Description)</td>
99
<td>@AddedVersion</td>
1010
</tr>

BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxMethodRow.razor.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@ public partial class DocxMethodRow<TItem> : BlazorBootstrapComponentBase
99

1010
private string Description => MethodInfo.GetMethodDescription();
1111

12-
public string ReturnType => MethodInfo.GetMethodReturnTypeName() ?? MethodInfo.GetMethodReturnType();
12+
public string ReturnType => MethodInfo.GetMethodReturnType();
1313

14-
public string MethodNameWithParameters => MethodInfo.GetMethodName() ?? $"{MethodInfo.Name}({MethodParameters})";
15-
16-
public string MethodParameters => MethodInfo.GetMethodParameters();
17-
18-
public string ReturnTypeShortName => ReturnType.Contains(".")
19-
? ReturnType.Split('.').Last()
20-
: ReturnType;
14+
public string MethodName => MethodInfo.GetMethodName();
2115

2216
[Parameter]
2317
public MethodInfo MethodInfo { get; set; } = default!;

BlazorBootstrap.Demo.RCL/Components/Shared/DocxTable/DocxPropertyRow.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<tr>
66
<td>@PropertyInfo.Name</td>
7-
<td class="text-danger">@PropertyTypeShortName</td>
7+
<td class="text-danger">@ParameterTypeName</td>
88
<td>@DefaultValue</td>
99
<td class="text-center">
1010
@if (IsRequired)

0 commit comments

Comments
 (0)