Documentation dump tool (/docs/generated/ for LLMs and tools like Context7)#1214
Documentation dump tool (/docs/generated/ for LLMs and tools like Context7)#1214
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce4a26ad0e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Havit.Blazor.Documentation.RepoDumpGenerator/Services/DocDumpService.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR introduces a new console tool (RepoDumpGenerator) that generates markdown documentation for all HAVIT Blazor components and types into the docs/generated/ directory. To support this functionality, common code was refactored from the MCP project into shared services within the Havit.Blazor.Documentation project. Additionally, the PR fixes naming inconsistencies in the documentation catalog (InputsSettings → InputSettings, BootstrapTheme → BootstrapFlavor) and removes a debug Console.WriteLine statement.
Changes:
- Added new
RepoDumpGeneratorconsole tool that dumps component and type documentation to markdown files - Refactored
McpDocMarkdownRendererand demo-related logic into shared services (DocMarkdownRenderer,ComponentDemosProvider) with corresponding interfaces - Fixed documentation catalog naming to match actual type names (InputSettings, BootstrapFlavor)
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Havit.Blazor.sln | Added RepoDumpGenerator project to solution |
| Havit.Blazor.slnLaunch | Added launch configuration for RepoDumpGenerator |
| Havit.Blazor.Documentation/Services/IDocMarkdownRenderer.cs | New interface for markdown rendering service |
| Havit.Blazor.Documentation/Services/IComponentDemosProvider.cs | New interface for component demo provider service |
| Havit.Blazor.Documentation/Services/DocumentationCatalogService.cs | Fixed type names (InputSettings, BootstrapFlavor) |
| Havit.Blazor.Documentation/Services/DocMarkdownRenderer.cs | Moved from MCP project, added includeMcpToolHint parameter |
| Havit.Blazor.Documentation/Services/ComponentDemosProvider.cs | New shared implementation for accessing embedded demo resources |
| Havit.Blazor.Documentation/Services/ApiDocModelBuilder.cs | Removed debug Console.WriteLine statement |
| Havit.Blazor.Documentation.RepoDumpGenerator/Services/DocDumpService.cs | New service that generates markdown documentation for components and types |
| Havit.Blazor.Documentation.RepoDumpGenerator/Program.cs | Entry point for the dump generator tool |
| Havit.Blazor.Documentation.RepoDumpGenerator/Havit.Blazor.Documentation.RepoDumpGenerator.csproj | Project file for new console tool |
| Havit.Blazor.Documentation.Mcp/Tools/GetTypeDocTool.cs | Updated to use shared IDocMarkdownRenderer interface |
| Havit.Blazor.Documentation.Mcp/Tools/GetComponentSamplesTool.cs | Refactored to use shared ComponentDemosProvider |
| Havit.Blazor.Documentation.Mcp/Tools/GetComponentDocsTool.cs | Refactored to use shared ComponentDemosProvider |
| Havit.Blazor.Documentation.Mcp/Program.cs | Updated DI registrations to use shared services |
| Havit.Blazor.Documentation.Mcp/Havit.Blazor.Documentation.Mcp.csproj | Added empty Services folder directive (cleanup needed) |
| Directory.Packages.props | Added Microsoft.Extensions.Hosting package reference |
Comments suppressed due to low confidence (1)
Havit.Blazor.Documentation/Services/DocMarkdownRenderer.cs:26
- For consistency with the codebase .editorconfig preferences (csharp_style_var_when_type_is_apparent = false:silent) and the pattern used elsewhere in this file (line 16), use the explicit type
StringBuilderinstead ofvarwhen the type is apparent from the right-hand side.
Havit.Blazor.Documentation.RepoDumpGenerator/Services/DocDumpService.cs
Outdated
Show resolved
Hide resolved
Havit.Blazor.Documentation.Mcp/Havit.Blazor.Documentation.Mcp.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ervice.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…csproj Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan * Fix: Include anchor-only components (HxNavLink, HxSubmit) in dump generation Co-authored-by: hakenr <12828888+hakenr@users.noreply.github.com> * Add edge case handling for anchor parsing Co-authored-by: hakenr <12828888+hakenr@users.noreply.github.com> * Optimize anchor extraction to reduce allocations Co-authored-by: hakenr <12828888+hakenr@users.noreply.github.com> * Further optimize component name extraction to avoid allocations Co-authored-by: hakenr <12828888+hakenr@users.noreply.github.com> * Add comment documenting path extraction assumption Co-authored-by: hakenr <12828888+hakenr@users.noreply.github.com> * Apply review suggestions: avoid double scan and clarify comment Co-authored-by: hakenr <12828888+hakenr@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hakenr <12828888+hakenr@users.noreply.github.com>
|
|
||
| var componentDir = outputRoot; | ||
| Directory.CreateDirectory(componentDir); | ||
| var filePath = Path.Combine(componentDir, $"{componentName}.md"); |
| // Demos | ||
| if (sampleNames.Count > 0) | ||
| { | ||
| var demosDir = Path.Combine(outputRoot, "demos", componentName); |
| if (content is not null) | ||
| { | ||
| var mdFileName = Path.ChangeExtension(sampleName, ".md"); | ||
| var demoFilePath = Path.Combine(demosDir, mdFileName); |
| var model = _modelProvider.GetApiDocModel(type); | ||
| var markdown = _renderer.RenderTypeDoc(model); | ||
|
|
||
| var typesDir = Path.Combine(outputRoot, "types"); |
|
|
||
| var typesDir = Path.Combine(outputRoot, "types"); | ||
| Directory.CreateDirectory(typesDir); | ||
| var filePath = Path.Combine(typesDir, $"{typeName}.md"); |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
Havit.Blazor.Documentation/Services/DocMarkdownRenderer.cs:26
- Inconsistent use of 'var' keyword. Line 16 uses explicit type 'StringBuilder sb = new StringBuilder()' while line 26 uses 'var sb = new StringBuilder()'. The codebase should be consistent in one approach or the other for variable declarations where the type is apparent from the right-hand side.
No description provided.