Skip to content

Commit 4ae7b97

Browse files
committed
Add XmlCommentGenerator example and documentation
Added XmlCommentGenerator as the 240th Roslyn Source Code Generator example, including new sample project, documentation, and related metadata. Updated README, lists, and category files to reflect the new example and incremented counts. Also fixed a minor link replacement in MultiGeneratorV2.cs.
1 parent ff768f6 commit 4ae7b97

File tree

30 files changed

+1591
-16
lines changed

30 files changed

+1591
-16
lines changed

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# RSCG - 239 Examples of Roslyn Source Code Generators / 15 created by Microsoft /
1+
# RSCG - 240 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
22

3-
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 239 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.
3+
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 240 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.
44

55
This system serves as both a learning resource for .NET developers interested in source generators and an automated pipeline for maintaining up-to-date documentation about the RSCG ecosystem
66

7-
## Latest Update : 2025-11-08 => 08 November 2025
7+
## Latest Update : 2025-11-09 => 09 November 2025
88

99
If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***
1010

@@ -24,8 +24,32 @@ If you want to be notified each time I add a new RSCG example , please click htt
2424

2525
## Content
2626

27-
Those are the 239 Roslyn Source Code Generators that I have tested you can see and download source code example.
28-
( including 15 from Microsoft )
27+
Those are the 240 Roslyn Source Code Generators that I have tested you can see and download source code example.
28+
( including 16 from Microsoft )
29+
### 240. [XmlCommentGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator) , in the [API](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) category
30+
31+
Generated on : 2025-11-09 => 09 November 2025
32+
33+
<details>
34+
<summary>Expand</summary>
35+
36+
37+
38+
Author: Microsoft
39+
40+
Provides APIs for annotating route handler endpoints in ASP.NET Core with OpenAPI annotations.
41+
42+
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/e77cb01b5529c137130757859f09f892dbdd2436
43+
44+
Nuget: [https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/)
45+
46+
47+
Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator)
48+
49+
Source: [https://github.com/dotnet/dotnet/](https://github.com/dotnet/dotnet/)
50+
51+
</details>
52+
2953
### 239. [TUnit](https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit) , in the [Tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) category
3054

3155
Generated on : 2025-11-08 => 08 November 2025

later.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Just later
22

3-
## Latest Update : 2025-11-08 => 08 November 2025
3+
## Latest Update : 2025-11-09 => 09 November 2025
44

55

66

v2/.tours/XmlCommentGenerator.tour

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
{
3+
"$schema": "https://aka.ms/codetour-schema",
4+
"title": "XmlCommentGenerator",
5+
"steps":
6+
[
7+
{
8+
"file": "rscg_examples/XmlCommentGenerator/src/TestProgram/TestProgram.csproj",
9+
"description": "First, we add Nuget [Microsoft.AspNetCore.OpenApi](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/) in csproj ",
10+
"pattern": "Microsoft.AspNetCore.OpenApi"
11+
}
12+
13+
,{
14+
"file": "rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs",
15+
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/XmlCommentGenerator/src/TestProgram/TestProgram.csproj ",
16+
"pattern": "this is the code"
17+
}
18+
19+
20+
,{
21+
"file": "rscg_examples/XmlCommentGenerator/src/TestProgram/obj/GX/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs",
22+
"description": "Generated File 1 from 1 : OpenApiXmlCommentSupport.generated.cs ",
23+
"line": 1
24+
}
25+
26+
],
27+
28+
"ref": "main"
29+
30+
}

v2/Generator/MultiGeneratorV2.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public string[] SourceNoRSCG()
145145
text = text.Replace("(di.gif)", $"({d.Generator!.Source}/di.gif)");
146146

147147
text = text.Replace("(./docs/", $"({d.Generator!.Source}/docs/");
148+
text = text.Replace("(/docs/", $"({d.Generator!.Source}/docs/");
148149

149150
text = text.Replace("(doc/", $"({d.Generator!.Source}/doc/");
150151
text = text.Replace("(docs/rules/", $"({d.Generator!.Source}/docs/rules/");

v2/Generator/all.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,4 @@ Nr,Key,Source,Category
238238
237,Program, https://github.com/dotnet/aspnetcore/,EnhancementClass
239239
238,TeCLI, https://github.com/tyevco/TeCLI,CommandLine
240240
239,TUnit, https://github.com/thomhurst/TUnit,Tests
241+
240,XmlCommentGenerator, https://github.com/dotnet/dotnet/,API

v2/RSCGExamplesData/GeneratorDataRec.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,5 +1447,11 @@
14471447
"Category":13,
14481448
"dtStart": "2025-11-08T00:00:00",
14491449
"show": true
1450+
},
1451+
{
1452+
"ID":"XmlCommentGenerator",
1453+
"Category":15,
1454+
"dtStart": "2025-11-09T00:00:00",
1455+
"show": true
14501456
}
14511457
]
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
<h1>RSCG nr 240 : XmlCommentGenerator</h1>
3+
4+
<h2>Info</h2>
5+
Nuget : <a href="https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/" target="_blank">https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/</a>
6+
7+
<p>You can find more details at : <a href="https://dotnet.microsoft.com/en-us/apps/aspnet" target="_blank"> https://dotnet.microsoft.com/en-us/apps/aspnet</a></p>
8+
9+
<p>Author :Microsoft</p>
10+
11+
<p>Source: <a href="https://github.com/dotnet/dotnet/" target="_blank">https://github.com/dotnet/dotnet/</a> </p>
12+
13+
<h2>About</h2>
14+
15+
Adding Xml comments to generated OpenAPI documentation
16+
17+
<h2>
18+
How to use
19+
</h2>
20+
<h3>
21+
Add reference to the <a href="https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/" target="_blank">XmlCommentGenerator</a> in the csproj
22+
</h3>
23+
<img src="images/XmlCommentGenerator/TestProgram.csproj.png" width="580" height="580" />
24+
25+
<h3>This was for me the <b>starting</b> code</h3>
26+
27+
<br />
28+
I have <b>coded</b> the file Program.cs
29+
<br />
30+
<img src="images/XmlCommentGenerator/csFiles/Program.cs.png" width="580" height="580" />
31+
<hr />
32+
<h3>And here are the <i>generated</i> files</h3>
33+
34+
<br />
35+
The file <i>generated</i> is OpenApiXmlCommentSupport.generated.cs
36+
<br />
37+
<img src="images/XmlCommentGenerator/generated/OpenApiXmlCommentSupport.generated.cs.png" width="580" height="580" />
38+
39+
<p>
40+
You can download the code and this page as pdf from
41+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator'>
42+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator
43+
</a>
44+
</p>
45+
46+
47+
<p>
48+
You can see the whole list at
49+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
50+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
51+
</a>
52+
</p>
53+

v2/book/list.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</head>
1818
<body>
1919
<h1>
20-
This is the list of 239 RSCG with examples =>
20+
This is the list of 240 RSCG with examples =>
2121
</h1>
2222

2323
<table >
@@ -982,6 +982,10 @@ <h1>
982982
<td>239</td>
983983
<td><a href="examples/TUnit.html">TUnit</a></td>
984984
</tr>
985+
<tr>
986+
<td>240</td>
987+
<td><a href="examples/XmlCommentGenerator.html">XmlCommentGenerator</a></td>
988+
</tr>
985989
</table>
986990

987991

v2/book/pandocHTML.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ input-files:
253253
- examples/Program.html
254254
- examples/TeCLI.html
255255
- examples/TUnit.html
256+
- examples/XmlCommentGenerator.html
256257

257258
# or you may use input-file: with a single value
258259
# defaults:
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"generator":{
3+
"name":"XmlCommentGenerator",
4+
"nuget":[
5+
"https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/"
6+
],
7+
"link":"https://dotnet.microsoft.com/en-us/apps/aspnet",
8+
"author":"Microsoft",
9+
"source":"https://github.com/dotnet/dotnet/"
10+
},
11+
"data":{
12+
"goodFor":["Adding Xml comments to generated OpenAPI documentation"],
13+
"csprojDemo":"TestProgram.csproj",
14+
"csFiles":["Program.cs"],
15+
"excludeDirectoryGenerated":["Microsoft.AspNetCore.App.SourceGenerators",
16+
"Microsoft.AspNetCore.Http.RequestDelegateGenerator",
17+
"System.Text.Json.SourceGeneration"],
18+
"includeAdditionalFiles":[""]
19+
},
20+
"links":{
21+
"blog":"",
22+
"video":""
23+
}
24+
}

0 commit comments

Comments
 (0)