Conversation
📝 WalkthroughWalkthroughThis pull request adds a new RSCG (Roslyn Source Code Generator) example for SvgIconGenerator to the documentation repository. It includes the demo project files, comprehensive documentation, metadata entries, interactive tour configuration, and updates example counts across all documentation pages to reflect the new 262nd example. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
7-31:⚠️ Potential issue | 🟡 MinorUpdate date in README.md to match PR timestamp or clarify if intentionally scheduled.
Lines 7 and 31 show
2026-04-04, but this PR was created on2026-04-03. Either adjust the date to the actual generation date or document if this is an intentional scheduled update.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 7 - 31, The README's "Latest Update : 2026-04-04 => 04 April 2026" and "Generated on : 2026-04-04 => 04 April 2026" dates are inconsistent with the PR creation date (2026-04-03); update those date strings (search for the exact text "Latest Update : 2026-04-04 => 04 April 2026" and "Generated on : 2026-04-04 => 04 April 2026") to the actual generation/PR date (2026-04-03) or, if the future date is intentional, add a short clarifying note next to those lines stating this is a scheduled/published-on date so reviewers know it's intentional.
🧹 Nitpick comments (3)
v2/.tours/SvgIconGenerator.tour (1)
26-42: Generated file steps are in reverse order.The generated file steps are numbered inconsistently: they show "Generated File 3 from 3" first, then "2 from 3", then "1 from 3". Consider reordering them 1→2→3 for a more intuitive walkthrough.
♻️ Suggested reordering
,{ - "file": "rscg_examples/SvgIconGenerator/src/DemoSvg/obj/GX/SvgIconGenerator/SvgIconGenerator.IconGenerator/MyIcons.g.cs", - "description": "Generated File 3 from 3 : MyIcons.g.cs ", + "file": "rscg_examples/SvgIconGenerator/src/DemoSvg/obj/GX/SvgIconGenerator/SvgIconGenerator.IconGenerator/GenerateIconsAttribute.g.cs", + "description": "Generated File 1 from 3 : GenerateIconsAttribute.g.cs ", "line": 1 } ,{ "file": "rscg_examples/SvgIconGenerator/src/DemoSvg/obj/GX/SvgIconGenerator/SvgIconGenerator.IconGenerator/IconDto.g.cs", "description": "Generated File 2 from 3 : IconDto.g.cs ", "line": 1 } ,{ - "file": "rscg_examples/SvgIconGenerator/src/DemoSvg/obj/GX/SvgIconGenerator/SvgIconGenerator.IconGenerator/GenerateIconsAttribute.g.cs", - "description": "Generated File 1 from 3 : GenerateIconsAttribute.g.cs ", + "file": "rscg_examples/SvgIconGenerator/src/DemoSvg/obj/GX/SvgIconGenerator/SvgIconGenerator.IconGenerator/MyIcons.g.cs", + "description": "Generated File 3 from 3 : MyIcons.g.cs ", "line": 1 }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@v2/.tours/SvgIconGenerator.tour` around lines 26 - 42, The tour lists generated files in reverse order; reorder the entries so they read 1→2→3 (GenerateIconsAttribute.g.cs as "Generated File 1 from 3", IconDto.g.cs as "Generated File 2 from 3", MyIcons.g.cs as "Generated File 3 from 3") and update the sequence in the SvgIconGenerator.tour JSON block so the walkthrough presents files in ascending logical order.v2/rscg_examples/SvgIconGenerator/src/DemoSvg/Icons.cs (1)
1-4: Consider removing unused imports.The
System,System.Collections.Generic, andSystem.Textnamespaces appear unused in this file. OnlySvgIconGeneratoris needed for the[GenerateIcons()]attribute.♻️ Optional cleanup
-using System; -using System.Collections.Generic; -using System.Text; using SvgIconGenerator; namespace DemoSvg;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@v2/rscg_examples/SvgIconGenerator/src/DemoSvg/Icons.cs` around lines 1 - 4, Remove the unused using directives at the top of Icons.cs — specifically delete using System;, using System.Collections.Generic;, and using System.Text; — leaving only using SvgIconGenerator; so the file only imports the namespace required for the [GenerateIcons()] attribute (look for the GenerateIcons attribute and the Icons.cs file to locate the code).v2/rscg_examples/SvgIconGenerator/description.json (1)
15-16: Consider using empty arrays instead of arrays with empty strings.Using
[""]instead of[]is unconventional. While the code handles this via length checks (skipping items withitem.Length==0), using empty arrays would be cleaner and more explicit about intent.♻️ Cleaner empty array notation
- "excludeDirectoryGenerated":[""], - "includeAdditionalFiles":[""] + "excludeDirectoryGenerated":[], + "includeAdditionalFiles":[]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@v2/rscg_examples/SvgIconGenerator/description.json` around lines 15 - 16, The JSON properties excludeDirectoryGenerated and includeAdditionalFiles currently use arrays with an empty string ([""]); change both to empty arrays ([]) to express intent clearly and avoid relying on downstream length or empty-string checks; update the values for "excludeDirectoryGenerated" and "includeAdditionalFiles" in description.json to use [] instead of [""].
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@v2/rscg_examples_site/docs/indexRSCG.md`:
- Line 23: Remove the trailing space inside the markdown link label in
indexRSCG.md by editing the table row that contains "[SvgIconGenerator by Matt
Schneeberger ]" and change it to "[SvgIconGenerator by Matt Schneeberger]"
(i.e., delete the space immediately before the closing bracket) so the link text
no longer triggers markdownlint MD039.
In `@v2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.md`:
- Around line 296-302: Remove the stray backslashes before braces in the C#
fenced-code examples so the dictionary initializer uses real braces instead of
escaped ones; e.g., change occurrences like "\{ \"width\", \"24\" }" and similar
entries ("height", "viewBox", "fill", "stroke", "stroke-width") to use plain "{
\"width\", \"24\" }" (apply the same fix to the other csharp block with the
escaped braces).
- Around line 363-467: The TabItem value attributes in the generated Markdown
use absolute Windows paths (the TabItem elements in SvgIconGenerator.md that
contain Program.cs, Icons.cs and generated file tabs) which makes the docs
non-portable; update each TabItem's value attribute to a relative, semantic
kebab-case identifier (e.g., "program-cs", "icons-cs", "generated-gx-icondto",
"generated-gx-generateiconsattribute", "generated-gx-myicons") while keeping the
label text and enclosed code blocks unchanged so the TabItem elements still
display the correct file name.
- Around line 56-266: The markdown uses invalid heading levels (lines like
"###### Installation" and many "######### ..." with 9 hashes), breaking
rendering; update heading levels so the top-level 6-hash becomes level 4 (change
"###### Installation" to "#### Installation") and change every "######### ..."
(the repeated 9-hash headings such as "######### 1. Organize Your SVG Files",
"######### 2. Add SVG Files as AdditionalFiles", "######### 3. Create an Icon
Class", "######### 4. Access Generated Icons", "######### 5. Render Icons", and
other similar sections) to level 5 (replace 9 hashes with 5: "##### ...") to
produce a consistent, incrementally-increasing hierarchy throughout the
document.
In `@v2/rscg_examples/SvgIconGenerator/video.json`:
- Around line 35-38: The JSON is invalid because the object in the steps array
uses assignment syntax SpeakTest=" " instead of a JSON key/value pair; update
that entry to use proper JSON syntax (e.g., "SpeakTest": " ") within the same
object in the array (the objects represented by
{"typeStep":"browser","arg":"https://...","SpeakTest": " "}) and ensure commas
and brackets remain valid so the file parses as JSON; after the change, validate
the file to confirm it's well-formed.
---
Outside diff comments:
In `@README.md`:
- Around line 7-31: The README's "Latest Update : 2026-04-04 => 04 April 2026"
and "Generated on : 2026-04-04 => 04 April 2026" dates are inconsistent with the
PR creation date (2026-04-03); update those date strings (search for the exact
text "Latest Update : 2026-04-04 => 04 April 2026" and "Generated on :
2026-04-04 => 04 April 2026") to the actual generation/PR date (2026-04-03) or,
if the future date is intentional, add a short clarifying note next to those
lines stating this is a scheduled/published-on date so reviewers know it's
intentional.
---
Nitpick comments:
In `@v2/.tours/SvgIconGenerator.tour`:
- Around line 26-42: The tour lists generated files in reverse order; reorder
the entries so they read 1→2→3 (GenerateIconsAttribute.g.cs as "Generated File 1
from 3", IconDto.g.cs as "Generated File 2 from 3", MyIcons.g.cs as "Generated
File 3 from 3") and update the sequence in the SvgIconGenerator.tour JSON block
so the walkthrough presents files in ascending logical order.
In `@v2/rscg_examples/SvgIconGenerator/description.json`:
- Around line 15-16: The JSON properties excludeDirectoryGenerated and
includeAdditionalFiles currently use arrays with an empty string ([""]); change
both to empty arrays ([]) to express intent clearly and avoid relying on
downstream length or empty-string checks; update the values for
"excludeDirectoryGenerated" and "includeAdditionalFiles" in description.json to
use [] instead of [""].
In `@v2/rscg_examples/SvgIconGenerator/src/DemoSvg/Icons.cs`:
- Around line 1-4: Remove the unused using directives at the top of Icons.cs —
specifically delete using System;, using System.Collections.Generic;, and using
System.Text; — leaving only using SvgIconGenerator; so the file only imports the
namespace required for the [GenerateIcons()] attribute (look for the
GenerateIcons attribute and the Icons.cs file to locate the code).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 782fe3bf-c155-461a-b19e-d3f74ec1fa52
⛔ Files ignored due to path filters (5)
v2/Generator/all.csvis excluded by!**/*.csvv2/rscg_examples/SvgIconGenerator/src/DemoSvg/Icons/Circle.svgis excluded by!**/*.svgv2/rscg_examples/SvgIconGenerator/src/DemoSvg/Icons/Rect.svgis excluded by!**/*.svgv2/rscg_examples_site/static/exports/RSCG.xlsxis excluded by!**/*.xlsxv2/rscg_examples_site/static/sources/SvgIconGenerator.zipis excluded by!**/*.zip
📒 Files selected for processing (24)
README.mdlater.mdv2/.tours/SvgIconGenerator.tourv2/RSCGExamplesData/GeneratorDataRec.jsonv2/book/examples/SvgIconGenerator.htmlv2/book/list.htmlv2/book/pandocHTML.yamlv2/rscg_examples/SvgIconGenerator/description.jsonv2/rscg_examples/SvgIconGenerator/nuget.txtv2/rscg_examples/SvgIconGenerator/readme.txtv2/rscg_examples/SvgIconGenerator/src/DemoSvg.slnxv2/rscg_examples/SvgIconGenerator/src/DemoSvg/DemoSvg.csprojv2/rscg_examples/SvgIconGenerator/src/DemoSvg/Icons.csv2/rscg_examples/SvgIconGenerator/src/DemoSvg/Program.csv2/rscg_examples/SvgIconGenerator/video.jsonv2/rscg_examples_site/docs/Authors/Matt_Schneeberger.mdv2/rscg_examples_site/docs/Categories/FilesToCode.mdv2/rscg_examples_site/docs/Categories/_PrimitiveFilesToCode.mdxv2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.mdv2/rscg_examples_site/docs/RSCG-Examples/index.mdv2/rscg_examples_site/docs/about.mdv2/rscg_examples_site/docs/indexRSCG.mdv2/rscg_examples_site/src/components/HomepageFeatures/index.jsv2/rscg_examples_site/static/exports/RSCG.json
|
|
||
| | No | Name | Date | Category | | ||
| | --------- | ----- | ---- | -------- | | ||
| |262| [SvgIconGenerator by Matt Schneeberger ](/docs/SvgIconGenerator)|2026-04-04 => 04 April 2026 | [FilesToCode](/docs/Categories/FilesToCode) | |
There was a problem hiding this comment.
Remove trailing space inside link text (markdownlint MD039).
Line 23 has a space before ] in [SvgIconGenerator by Matt Schneeberger ], which triggers lint noise and can fail strict markdown checks.
✂️ Suggested fix
-|262| [SvgIconGenerator by Matt Schneeberger ](/docs/SvgIconGenerator)|2026-04-04 => 04 April 2026 | [FilesToCode](/docs/Categories/FilesToCode) |
+|262| [SvgIconGenerator by Matt Schneeberger](/docs/SvgIconGenerator)|2026-04-04 => 04 April 2026 | [FilesToCode](/docs/Categories/FilesToCode) |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| |262| [SvgIconGenerator by Matt Schneeberger ](/docs/SvgIconGenerator)|2026-04-04 => 04 April 2026 | [FilesToCode](/docs/Categories/FilesToCode) | | |
| |262| [SvgIconGenerator by Matt Schneeberger](/docs/SvgIconGenerator)|2026-04-04 => 04 April 2026 | [FilesToCode](/docs/Categories/FilesToCode) | |
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)
[warning] 23-23: Spaces inside link text
(MD039, no-space-in-links)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@v2/rscg_examples_site/docs/indexRSCG.md` at line 23, Remove the trailing
space inside the markdown link label in indexRSCG.md by editing the table row
that contains "[SvgIconGenerator by Matt Schneeberger ]" and change it to
"[SvgIconGenerator by Matt Schneeberger]" (i.e., delete the space immediately
before the closing bracket) so the link text no longer triggers markdownlint
MD039.
| ###### Installation | ||
|
|
||
| Install the NuGet package in your project: | ||
|
|
||
| ```bash | ||
| dotnet add package SvgIconGenerator | ||
| ``` | ||
|
|
||
| ###### Usage | ||
|
|
||
| ######### 1. Organize Your SVG Files | ||
|
|
||
| Place your SVG icon files in a folder within your project (e.g., `Icons/`): | ||
|
|
||
| ``` | ||
| YourProject/ | ||
| ├── Icons/ | ||
| │ ├── user-circle.svg | ||
| │ ├── home.svg | ||
| │ └── settings.svg | ||
| └── Program.cs | ||
| ``` | ||
|
|
||
| ######### 2. Add SVG Files as AdditionalFiles | ||
|
|
||
| In your `.csproj` file, add the SVG files as `AdditionalFiles`: | ||
|
|
||
| ```xml | ||
| <ItemGroup> | ||
| <AdditionalFiles Include="Icons/*.svg" /> | ||
| </ItemGroup> | ||
| ``` | ||
|
|
||
| **Important**: Adding files as `AdditionalFiles` ensures that changes to SVG files trigger regeneration during incremental compilation. | ||
|
|
||
| ######### 3. Create an Icon Class | ||
|
|
||
| Create a `static partial` class and decorate it with the `[GenerateIcons]` attribute: | ||
|
|
||
| ```csharp | ||
| [GenerateIcons] | ||
| internal static partial class MyIcons; | ||
| ``` | ||
|
|
||
| You can optionally specify a glob pattern to filter which SVG files to include: | ||
|
|
||
| ```csharp | ||
| // Include all SVG files from AdditionalFiles | ||
| [GenerateIcons] | ||
| internal static partial class AllIcons; | ||
|
|
||
| // Filter by glob pattern | ||
| [GenerateIcons("Icons/*.svg")] | ||
| internal static partial class MyIcons; | ||
| ``` | ||
|
|
||
| ######### 4. Access Generated Icons | ||
|
|
||
| The source generator will create properties for each SVG file. Property names are automatically converted from kebab-case to PascalCase: | ||
|
|
||
| ```csharp | ||
| // user-circle.svg becomes UserCircle | ||
| IconDto icon = MyIcons.UserCircle; | ||
|
|
||
| Console.WriteLine($"Icon name: {icon.Name}"); | ||
| Console.WriteLine($"ViewBox: {icon.DefaultAttributes["viewBox"]}"); | ||
| Console.WriteLine($"SVG content: {icon.InnerContent}"); | ||
| ``` | ||
|
|
||
| ######### 5. Render Icons | ||
|
|
||
| The `IconDto` contains everything needed to render the icon: | ||
|
|
||
| ```csharp | ||
| public static string RenderIcon(IconDto icon, Dictionary<string, string>? customAttributes = null) | ||
| { | ||
| // Merge default attributes with custom overrides | ||
| var attributes = new Dictionary<string, string>(icon.DefaultAttributes); | ||
| if (customAttributes != null) | ||
| { | ||
| foreach (var kvp in customAttributes) | ||
| { | ||
| attributes[kvp.Key] = kvp.Value; | ||
| } | ||
| } | ||
|
|
||
| // Build attribute string | ||
| var attrString = string.Join(" ", attributes.Select(kvp => $"{kvp.Key}=\"{kvp.Value}\"")); | ||
|
|
||
| // Return complete SVG | ||
| return $"<svg {attrString}>{icon.InnerContent}</svg>"; | ||
| } | ||
|
|
||
| // Use it | ||
| string svg = RenderIcon(MyIcons.UserCircle, new Dictionary<string, string> | ||
| { | ||
| ["class"] = "icon", | ||
| ["width"] = "24", | ||
| ["height"] = "24" | ||
| }); | ||
| ``` | ||
|
|
||
| ###### Using with Popular Icon Libraries | ||
|
|
||
| You can use this generator with popular icon libraries installed via NPM, such as Bootstrap Icons, Lucide, Heroicons, or Feather Icons. | ||
|
|
||
| ######### Example: Lucide Icons | ||
|
|
||
| 1. Install Lucide icons via NPM: | ||
|
|
||
| ```bash | ||
| npm install lucide-static | ||
| ``` | ||
|
|
||
| 2. Add the icons as `AdditionalFiles` in your `.csproj`: | ||
|
|
||
| ```xml | ||
| <ItemGroup> | ||
| <AdditionalFiles Include="node_modules/lucide-static/icons/*.svg" /> | ||
| </ItemGroup> | ||
| ``` | ||
|
|
||
| 3. Create the icon class with optional glob pattern filter: | ||
|
|
||
| ```csharp | ||
| [GenerateIcons("node_modules/lucide-static/icons/*.svg")] | ||
| internal static partial class LucideIcons; | ||
| ``` | ||
|
|
||
| 4. Access any Lucide icon: | ||
|
|
||
| ```csharp | ||
| IconDto icon = LucideIcons.UserCircle; | ||
| IconDto icon2 = LucideIcons.ShoppingCart; | ||
| IconDto icon3 = LucideIcons.AlertTriangle; | ||
| ``` | ||
|
|
||
| ######### Example: Bootstrap Icons | ||
|
|
||
| ```bash | ||
| npm install bootstrap-icons | ||
| ``` | ||
|
|
||
| ```xml | ||
| <ItemGroup> | ||
| <AdditionalFiles Include="node_modules/bootstrap-icons/icons/*.svg" /> | ||
| </ItemGroup> | ||
| ``` | ||
|
|
||
| ```csharp | ||
| [GenerateIcons("node_modules/bootstrap-icons/icons/*.svg")] | ||
| internal static partial class BootstrapIcons; | ||
| ``` | ||
|
|
||
| ######### Example: Heroicons | ||
|
|
||
| ```bash | ||
| npm install heroicons | ||
| ``` | ||
|
|
||
| ```xml | ||
| <ItemGroup> | ||
| <AdditionalFiles Include="node_modules/heroicons/24/outline/*.svg" /> | ||
| <AdditionalFiles Include="node_modules/heroicons/24/solid/*.svg" /> | ||
| </ItemGroup> | ||
| ``` | ||
|
|
||
| ```csharp | ||
| // Outline style icons | ||
| [GenerateIcons("node_modules/heroicons/24/outline/*.svg")] | ||
| internal static partial class HeroiconsOutline; | ||
|
|
||
| // Solid style icons | ||
| [GenerateIcons("node_modules/heroicons/24/solid/*.svg")] | ||
| internal static partial class HeroiconsSolid; | ||
| ``` | ||
|
|
||
| ######### Multiple Icon Sets | ||
|
|
||
| You can create multiple icon classes in the same project to organize different icon sets: | ||
|
|
||
| ```xml | ||
| <ItemGroup> | ||
| <AdditionalFiles Include="node_modules/lucide-static/icons/*.svg" /> | ||
| <AdditionalFiles Include="Icons/custom/*.svg" /> | ||
| <AdditionalFiles Include="Icons/logos/*.svg" /> | ||
| </ItemGroup> | ||
| ``` | ||
|
|
||
| ```csharp | ||
| [GenerateIcons("node_modules/lucide-static/icons/*.svg")] | ||
| internal static partial class LucideIcons; | ||
|
|
||
| [GenerateIcons("Icons/custom/*.svg")] | ||
| internal static partial class CustomIcons; | ||
|
|
||
| [GenerateIcons("Icons/logos/*.svg")] | ||
| internal static partial class LogoIcons; | ||
| ``` | ||
|
|
||
| ###### How It Works | ||
|
|
||
| 1. The source generator reads SVG files from `AdditionalFiles` in your project | ||
| 2. Files are optionally filtered by glob pattern (if specified in the attribute) | ||
| 3. For each SVG file, it: | ||
| - Extracts the root element's attributes (excluding `xmlns` and `class`) | ||
| - Captures the inner SVG content | ||
| - Converts the filename to PascalCase for the property name | ||
| 4. Generates a partial class with `IconDto` properties for each icon | ||
| 5. **Incremental compilation**: Changes to SVG files automatically trigger regeneration | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -nP '^#{7,}\s' v2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.mdRepository: ignatandrei/RSCG_Examples
Length of output: 405
Normalize heading levels — multiple headings use invalid syntax (9 hashes exceed markdown maximum of 6).
Lines 66, 79, 91, 112, 125, 162, 193, 210, 233 all start with 9 hashes (#########), which is invalid markdown and breaks heading rendering, linting, and TOC generation. Line 56 uses 6 hashes (###### Installation), which is the maximum valid level but inconsistent with the section structure.
Reduce 6-hash headings to #### (level 4) and 9-hash headings to ##### (level 5) for a consistent, incrementally-increasing hierarchy:
Proposed fix pattern
-###### Installation
+#### Installation
-######### 1. Organize Your SVG Files
+##### 1. Organize Your SVG FilesApply to all ######### sections (9 lines total) and adjust 6-hash headings accordingly.
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)
[warning] 56-56: Heading levels should only increment by one level at a time
Expected: h4; Actual: h6
(MD001, heading-increment)
[warning] 70-70: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@v2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.md` around lines 56
- 266, The markdown uses invalid heading levels (lines like "######
Installation" and many "######### ..." with 9 hashes), breaking rendering;
update heading levels so the top-level 6-hash becomes level 4 (change "######
Installation" to "#### Installation") and change every "######### ..." (the
repeated 9-hash headings such as "######### 1. Organize Your SVG Files",
"######### 2. Add SVG Files as AdditionalFiles", "######### 3. Create an Icon
Class", "######### 4. Access Generated Icons", "######### 5. Render Icons", and
other similar sections) to level 5 (replace 9 hashes with 5: "##### ...") to
produce a consistent, incrementally-increasing hierarchy throughout the
document.
| \{ "width", "24" }, | ||
| \{ "height", "24" }, | ||
| \{ "viewBox", "0 0 24 24" }, | ||
| \{ "fill", "none" }, | ||
| \{ "stroke", "currentColor" }, | ||
| \{ "stroke-width", "2" }, | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n '\\\{' v2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.mdRepository: ignatandrei/RSCG_Examples
Length of output: 454
🏁 Script executed:
sed -n '285,310p' v2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.mdRepository: ignatandrei/RSCG_Examples
Length of output: 752
🏁 Script executed:
sed -n '480,510p' v2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.mdRepository: ignatandrei/RSCG_Examples
Length of output: 1047
Remove escaped braces from C# code blocks.
Lines 296–301 and 488–500 contain escaped braces \{ ... } within csharp fence blocks. In markdown, these backslashes render literally and make the example code appear syntactically invalid. Remove the backslashes to display proper C# dictionary initialization syntax: { ... }.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@v2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.md` around lines
296 - 302, Remove the stray backslashes before braces in the C# fenced-code
examples so the dictionary initializer uses real braces instead of escaped ones;
e.g., change occurrences like "\{ \"width\", \"24\" }" and similar entries
("height", "viewBox", "fill", "stroke", "stroke-width") to use plain "{
\"width\", \"24\" }" (apply the same fix to the other csharp block with the
escaped braces).
| <TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\Program.cs" label="Program.cs" > | ||
|
|
||
| This is the use of **SvgIconGenerator** in *Program.cs* | ||
|
|
||
| ```csharp showLineNumbers | ||
| using DemoSvg; | ||
|
|
||
| Console.WriteLine(MyIcons.Circle.Name); | ||
|
|
||
| Console.WriteLine(MyIcons.Rect.InnerContent); | ||
|
|
||
| ``` | ||
| </TabItem> | ||
|
|
||
| <TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\Icons.cs" label="Icons.cs" > | ||
|
|
||
| This is the use of **SvgIconGenerator** in *Icons.cs* | ||
|
|
||
| ```csharp showLineNumbers | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
| using SvgIconGenerator; | ||
| namespace DemoSvg; | ||
|
|
||
| [GenerateIcons()] | ||
| internal static partial class MyIcons; | ||
|
|
||
|
|
||
| ``` | ||
| </TabItem> | ||
|
|
||
| </Tabs> | ||
|
|
||
| ### Generated Files | ||
|
|
||
| Those are taken from $(BaseIntermediateOutputPath)\GX | ||
| <Tabs> | ||
|
|
||
|
|
||
| <TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\obj\GX\SvgIconGenerator\SvgIconGenerator.IconGenerator\GenerateIconsAttribute.g.cs" label="GenerateIconsAttribute.g.cs" > | ||
| ```csharp showLineNumbers | ||
| namespace SvgIconGenerator | ||
| { | ||
| /// <summary> | ||
| /// Marks a static partial class for icon generation. | ||
| /// The source generator will scan AdditionalFiles for SVG files matching the specified glob pattern | ||
| /// and generate static readonly IconDto properties for each icon found. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// SVG files must be added to the project as AdditionalFiles in the .csproj file: | ||
| /// <code> | ||
| /// <ItemGroup> | ||
| /// <AdditionalFiles Include="icons/**/*.svg" /> | ||
| /// </ItemGroup> | ||
| /// </code> | ||
| /// </remarks> | ||
| [global::System.AttributeUsage(global::System.AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | ||
| internal sealed class GenerateIconsAttribute : global::System.Attribute | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="GenerateIconsAttribute"/> class. | ||
| /// </summary> | ||
| public GenerateIconsAttribute() | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="GenerateIconsAttribute"/> class. | ||
| /// </summary> | ||
| /// <param name="globPattern"> | ||
| /// Optional glob pattern to filter SVG files from AdditionalFiles. | ||
| /// If not specified, all SVG files in AdditionalFiles will be included. | ||
| /// Supports * (wildcard) and ** (recursive) patterns. | ||
| /// Example: <code>"node_modules/lucide-static/icons/*.svg"</code> | ||
| /// </param> | ||
| public GenerateIconsAttribute(string globPattern) | ||
| { | ||
| } | ||
| } | ||
| } | ||
|
|
||
| ``` | ||
| </TabItem> | ||
|
|
||
|
|
||
| <TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\obj\GX\SvgIconGenerator\SvgIconGenerator.IconGenerator\IconDto.g.cs" label="IconDto.g.cs" > | ||
| ```csharp showLineNumbers | ||
| namespace SvgIconGenerator | ||
| { | ||
| /// <summary> | ||
| /// Represents an icon with its SVG metadata and content. | ||
| /// This type is generated by the IconGenerator source generator. | ||
| /// </summary> | ||
| /// <param name="Name">The kebab-case name of the icon (e.g., "circle-user-round").</param> | ||
| /// <param name="DefaultAttributes">The default attributes from the SVG root element (excluding xmlns). Common attributes include: width, height, viewBox, fill, stroke, stroke-width, stroke-linecap, stroke-linejoin.</param> | ||
| /// <param name="InnerContent">The inner HTML content of the SVG element (paths, circles, lines, etc.).</param> | ||
| public sealed record IconDto(string Name, global::System.Collections.Generic.IReadOnlyDictionary<string, string> DefaultAttributes, string InnerContent); | ||
| } | ||
|
|
||
| ``` | ||
| </TabItem> | ||
|
|
||
|
|
||
| <TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\obj\GX\SvgIconGenerator\SvgIconGenerator.IconGenerator\MyIcons.g.cs" label="MyIcons.g.cs" > |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -nP '<TabItem value="[^"]*\\[^"]*"' v2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.mdRepository: ignatandrei/RSCG_Examples
Length of output: 875
Replace absolute Windows paths in TabItem value attributes with relative identifiers.
Lines 363, 377, 403, 449, and 467 use absolute Windows paths (e.g., D:\gth\RSCG_Examples\...) as TabItem identifiers. These are machine-specific and reduce portability. Use kebab-case semantic identifiers instead.
Suggested replacements
-<TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\Program.cs" label="Program.cs" >
+<TabItem value="program-cs" label="Program.cs" >
-<TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\Icons.cs" label="Icons.cs" >
+<TabItem value="icons-cs" label="Icons.cs" >
-<TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\obj\GX\SvgIconGenerator\SvgIconGenerator.IconGenerator\GenerateIconsAttribute.g.cs" label="GenerateIconsAttribute.g.cs" >
+<TabItem value="generate-icons-attribute-g-cs" label="GenerateIconsAttribute.g.cs" >
-<TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\obj\GX\SvgIconGenerator\SvgIconGenerator.IconGenerator\IconDto.g.cs" label="IconDto.g.cs" >
+<TabItem value="icon-dto-g-cs" label="IconDto.g.cs" >
-<TabItem value="D:\gth\RSCG_Examples\v2\rscg_examples\SvgIconGenerator\src\DemoSvg\obj\GX\SvgIconGenerator\SvgIconGenerator.IconGenerator\MyIcons.g.cs" label="MyIcons.g.cs" >
+<TabItem value="my-icons-g-cs" label="MyIcons.g.cs" >🧰 Tools
🪛 markdownlint-cli2 (0.22.0)
[warning] 430-430: Code block style
Expected: fenced; Actual: indented
(MD046, code-block-style)
[warning] 445-445: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@v2/rscg_examples_site/docs/RSCG-Examples/SvgIconGenerator.md` around lines
363 - 467, The TabItem value attributes in the generated Markdown use absolute
Windows paths (the TabItem elements in SvgIconGenerator.md that contain
Program.cs, Icons.cs and generated file tabs) which makes the docs non-portable;
update each TabItem's value attribute to a relative, semantic kebab-case
identifier (e.g., "program-cs", "icons-cs", "generated-gx-icondto",
"generated-gx-generateiconsattribute", "generated-gx-myicons") while keeping the
label text and enclosed code blocks unchanged so the TabItem elements still
display the correct file name.
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/SvgIconGenerator#download-example-net--c-", | ||
| SpeakTest=" "}, | ||
| {"typeStep":"waitseconds","arg":"30"}, | ||
| ] |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
python - <<'PY'
import json
from pathlib import Path
p = Path("v2/rscg_examples/SvgIconGenerator/video.json")
try:
json.loads(p.read_text(encoding="utf-8"))
print("OK: JSON is valid")
except Exception as e:
print(f"ERROR: JSON is invalid -> {e}")
PYRepository: ignatandrei/RSCG_Examples
Length of output: 174
Fix invalid JSON syntax (parse blocker).
Line 36 uses assignment syntax (SpeakTest=" ") instead of JSON key/value syntax, making the file unparseable.
Proposed fix
-{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/SvgIconGenerator#download-example-net--c-",
-SpeakTest=" "},
+{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/SvgIconGenerator#download-example-net--c-"},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/SvgIconGenerator#download-example-net--c-", | |
| SpeakTest=" "}, | |
| {"typeStep":"waitseconds","arg":"30"}, | |
| ] | |
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/SvgIconGenerator#download-example-net--c-"}, | |
| {"typeStep":"waitseconds","arg":"30"}, | |
| ] |
🧰 Tools
🪛 Biome (2.4.9)
[error] 36-36: Property key must be double quoted
(parse)
[error] 36-36: unexpected character =
(parse)
[error] 36-36: expected , but instead found " "
(parse)
[error] 36-36: expected : but instead found }
(parse)
[error] 38-38: Expected an array, an object, or a literal but instead found ']'.
(parse)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@v2/rscg_examples/SvgIconGenerator/video.json` around lines 35 - 38, The JSON
is invalid because the object in the steps array uses assignment syntax
SpeakTest=" " instead of a JSON key/value pair; update that entry to use proper
JSON syntax (e.g., "SpeakTest": " ") within the same object in the array (the
objects represented by {"typeStep":"browser","arg":"https://...","SpeakTest": "
"}) and ensure commas and brackets remain valid so the file parses as JSON;
after the change, validate the file to confirm it's well-formed.
There was a problem hiding this comment.
Pull request overview
Adds a new RSCG example for SvgIconGenerator to the v2 catalog and site assets, including a minimal demo project and accompanying metadata/resources used by the documentation/site pipeline.
Changes:
- Register SvgIconGenerator in the central generator data list.
- Add a new
SvgIconGeneratorexample (demo project, icons, metadata, and video script). - Add/refresh downloadable/export artifacts for the site (example zip + Excel export).
Reviewed changes
Copilot reviewed 25 out of 29 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| v2/RSCGExamplesData/GeneratorDataRec.json | Adds the SvgIconGenerator entry (ID/category/date/show) to the generator registry. |
| v2/rscg_examples/SvgIconGenerator/video.json | Adds the scripted steps for producing the example walkthrough video. |
| v2/rscg_examples/SvgIconGenerator/src/DemoSvg/Program.cs | Demo usage of generated icon properties. |
| v2/rscg_examples/SvgIconGenerator/src/DemoSvg/Icons/Rect.svg | Adds a sample rectangle SVG input. |
| v2/rscg_examples/SvgIconGenerator/src/DemoSvg/Icons/Circle.svg | Adds a sample circle SVG input. |
| v2/rscg_examples/SvgIconGenerator/src/DemoSvg/Icons.cs | Declares the partial icon container class with [GenerateIcons]. |
| v2/rscg_examples/SvgIconGenerator/src/DemoSvg/DemoSvg.csproj | New demo project referencing SvgIconGenerator and including SVGs as AdditionalFiles. |
| v2/rscg_examples/SvgIconGenerator/src/DemoSvg.slnx | Solution wrapper for the demo project. |
| v2/rscg_examples/SvgIconGenerator/readme.txt | Adds the generator’s usage/readme content for the example. |
| v2/rscg_examples/SvgIconGenerator/nuget.txt | Short NuGet description snippet used by the site pipeline. |
| v2/rscg_examples/SvgIconGenerator/description.json | Site metadata describing the generator, links, and demo file list. |
| v2/rscg_examples_site/static/sources/SvgIconGenerator.zip | Downloadable packaged source for the example. |
| v2/rscg_examples_site/static/exports/RSCG.xlsx | Updated/added Excel export of the RSCG list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary by CodeRabbit
Release Notes
New Features
Documentation