Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RSCG - 247 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
# RSCG - 248 Examples of Roslyn Source Code Generators / 16 created by Microsoft /

The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 247 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.
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 248 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.

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

## Latest Update : 2025-12-14 => 14 December 2025
## Latest Update : 2025-12-15 => 15 December 2025

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

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

## Content

Those are the 247 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 248 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 16 from Microsoft )
### 248. [docopt.net](https://ignatandrei.github.io/RSCG_Examples/v2/docs/docopt.net) , in the [CommandLine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) category

Generated on : 2025-12-15 => 15 December 2025

<details>
<summary>Expand</summary>



Author: Atif Aziz

docopt.net is the .net version of the docopt python beautiful command line parser. docopt.net helps you define an interface for your command-line app, and automatically generate a parser for it. docopt.net is based on conventions that have been used for decades in help messages and man pages for program interface description. Interface description in docopt.net is such a help message, but formalized. Check out http://docopt.org for a more detailed explanation.
Quick example: var arguments = new DocOpt().Apply("Usage: prog [-a] [-b] FILE", args); if (arguments["-a"].IsTrue) { ... }
}

Nuget: [https://www.nuget.org/packages/docopt.net/](https://www.nuget.org/packages/docopt.net/)


Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/docopt.net](https://ignatandrei.github.io/RSCG_Examples/v2/docs/docopt.net)

Source: [https://github.com/docopt/docopt.net](https://github.com/docopt/docopt.net)

</details>

### 247. [BlazorOcticons](https://ignatandrei.github.io/RSCG_Examples/v2/docs/BlazorOcticons) , in the [Blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) category

Generated on : 2025-12-14 => 14 December 2025
Expand Down
2 changes: 1 addition & 1 deletion later.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Just later

## Latest Update : 2025-12-14 => 14 December 2025
## Latest Update : 2025-12-15 => 15 December 2025



Expand Down
36 changes: 36 additions & 0 deletions v2/.tours/docopt.net.tour
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

{
"$schema": "https://aka.ms/codetour-schema",
"title": "docopt.net",
"steps":
[
{
"file": "rscg_examples/docopt.net/src/ConsoleArgs/ConsoleArgs.csproj",
"description": "First, we add Nuget [docopt.net](https://www.nuget.org/packages/docopt.net/) in csproj ",
"pattern": "docopt.net"
}

,{
"file": "rscg_examples/docopt.net/src/ConsoleArgs/Program.docopt.txt",
"description": "File Program.docopt.txt ",
"pattern": "this is the code"
}

,{
"file": "rscg_examples/docopt.net/src/ConsoleArgs/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/docopt.net/src/ConsoleArgs/ConsoleArgs.csproj ",
"pattern": "this is the code"
}


,{
"file": "rscg_examples/docopt.net/src/ConsoleArgs/obj/GX/DocoptNet/DocoptNet.CodeGeneration.SourceGenerator/ConsoleArgs.ProgramArguments.cs",
"description": "Generated File 1 from 1 : ConsoleArgs.ProgramArguments.cs ",
"line": 1
}

],

"ref": "main"

}
1 change: 1 addition & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,4 @@ Nr,Key,Source,Category
245,Monify, https://github.com/MooVC/monify,PrimitiveObsession
246,Imposter, https://github.com/themidnightgospel/Imposter,Tests
247,BlazorOcticons, https://github.com/BlazorOcticons/BlazorOcticons,Blazor
248,docopt.net, https://github.com/docopt/docopt.net,CommandLine
6 changes: 6 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1497,5 +1497,11 @@
"Category": 21,
"dtStart": "2025-12-14T00:00:00",
"show": true
},
{
"ID": "docopt.net",
"Category": 32,
"dtStart": "2025-12-15T00:00:00",
"show": true
}
]
59 changes: 59 additions & 0 deletions v2/book/examples/docopt.net.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

<h1>RSCG nr 248 : docopt.net</h1>

<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/docopt.net/" target="_blank">https://www.nuget.org/packages/docopt.net/</a>

<p>You can find more details at : <a href="https://github.com/docopt/docopt.net" target="_blank"> https://github.com/docopt/docopt.net</a></p>

<p>Author :Atif Aziz</p>

<p>Source: <a href="https://github.com/docopt/docopt.net" target="_blank">https://github.com/docopt/docopt.net</a> </p>

<h2>About</h2>

Generating command line argument parsers from usage documentation.

<h2>
How to use
</h2>
<h3>
Add reference to the <a href="https://www.nuget.org/packages/docopt.net/" target="_blank">docopt.net</a> in the csproj
</h3>
<img src="images/docopt.net/ConsoleArgs.csproj.png" width="580" height="580" />

<h3>This was for me the <b>starting</b> code</h3>

<br />
I have <b>coded</b> the file Program.cs
<br />
<img src="images/docopt.net/csFiles/Program.cs.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file Program.docopt.txt
<br />
<img src="images/docopt.net/csFiles/Program.docopt.txt.png" width="580" height="580" />
<hr />
<h3>And here are the <i>generated</i> files</h3>

<br />
The file <i>generated</i> is ConsoleArgs.ProgramArguments.cs
<br />
<img src="images/docopt.net/generated/ConsoleArgs.ProgramArguments.cs.png" width="580" height="580" />

<p>
You can download the code and this page as pdf from
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/docopt.net'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/docopt.net
</a>
</p>


<p>
You can see the whole list at
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
</a>
</p>

6 changes: 5 additions & 1 deletion v2/book/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>
<body>
<h1>
This is the list of 247 RSCG with examples =>
This is the list of 248 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -1014,6 +1014,10 @@ <h1>
<td>247</td>
<td><a href="examples/BlazorOcticons.html">BlazorOcticons</a></td>
</tr>
<tr>
<td>248</td>
<td><a href="examples/docopt.net.html">docopt.net</a></td>
</tr>
</table>


Expand Down
1 change: 1 addition & 0 deletions v2/book/pandocHTML.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ input-files:
- examples/Monify.html
- examples/Imposter.html
- examples/BlazorOcticons.html
- examples/docopt.net.html

# or you may use input-file: with a single value
# defaults:
Expand Down
22 changes: 22 additions & 0 deletions v2/rscg_examples/docopt.net/description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"generator":{
"name":"docopt.net",
"nuget":[
"https://www.nuget.org/packages/docopt.net/"
],
"link":"https://github.com/docopt/docopt.net",
"author":"Atif Aziz",
"source":"https://github.com/docopt/docopt.net"
},
"data":{
"goodFor":["Generating command line argument parsers from usage documentation."],
"csprojDemo":"ConsoleArgs.csproj",
"csFiles":["Program.cs","Program.docopt.txt"],
"excludeDirectoryGenerated":[""],
"includeAdditionalFiles":[""]
},
"links":{
"blog":"",
"video":""
}
}
3 changes: 3 additions & 0 deletions v2/rscg_examples/docopt.net/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docopt.net is the .net version of the docopt python beautiful command line parser. docopt.net helps you define an interface for your command-line app, and automatically generate a parser for it. docopt.net is based on conventions that have been used for decades in help messages and man pages for program interface description. Interface description in docopt.net is such a help message, but formalized. Check out http://docopt.org for a more detailed explanation.
Quick example: var arguments = new DocOpt().Apply("Usage: prog [-a] [-b] FILE", args); if (arguments["-a"].IsTrue) { ... }
}
101 changes: 101 additions & 0 deletions v2/rscg_examples/docopt.net/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# **docopt.net** is a .NET implementation of [docopt]

**docopt.net** is a parser for command-line arguments. It automatically derives
the parsing logic from the help text of a program containing its command-line
usage in [docopt] format. [docopt] is the formalization of conventions that have
been used for decades in help messages and man pages for describing a program's
interface. Below is an example of such a help text containing the usage for a
hypothetical program called Naval Fate:

Naval Fate.

Usage:
naval_fate.exe ship new <name>...
naval_fate.exe ship <name> move <x> <y> [--speed=<kn>]
naval_fate.exe ship shoot <x> <y>
naval_fate.exe mine (set|remove) <x> <y> [--moored | --drifting]
naval_fate.exe (-h | --help)
naval_fate.exe --version

Options:
-h --help Show this screen.
--version Show version.
--speed=<kn> Speed in knots [default: 10].
--moored Moored (anchored) mine.
--drifting Drifting mine.

## Usage

The following C# example shows one basic way to use **docopt.net**:

```c#
#nullable enable

using System;
using DocoptNet;

const string usage = @"Naval Fate.

Usage:
naval_fate.exe ship new <name>...
naval_fate.exe ship <name> move <x> <y> [--speed=<kn>]
naval_fate.exe ship shoot <x> <y>
naval_fate.exe mine (set|remove) <x> <y> [--moored | --drifting]
naval_fate.exe (-h | --help)
naval_fate.exe --version

Options:
-h --help Show this screen.
--version Show version.
--speed=<kn> Speed in knots [default: 10].
--moored Moored (anchored) mine.
--drifting Drifting mine.

";

var arguments = new Docopt().Apply(usage, args, version: "Naval Fate 2.0", exit: true)!;
foreach (var (key, value) in arguments)
Console.WriteLine("{0} = {1}", key, value);
```

See the [documentation] for more examples and uses of the **docopt.net** API.

## Documentation

The documentation can be found online at <https://docopt.github.io/docopt.net/>.

## Installation

Install [the package][nupkg] in a .NET project using:

dotnet add package docopt.net

## Copyright and License

- &copy; 2012-2014 Vladimir Keleshev <[email protected]>
- &copy; 2013 Dinh Doan Van Bien <[email protected]>
- &copy; 2021 Atif Aziz
- Portions &copy; .NET Foundation and Contributors
- Portions &copy; West Wind Technologies, 2008

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[docopt]: http://docopt.org/
[nupkg]: https://www.nuget.org/packages/docopt.net
[documentation]: https://docopt.github.io/docopt.net/
3 changes: 3 additions & 0 deletions v2/rscg_examples/docopt.net/src/ConsoleArgs.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Solution>
<Project Path="ConsoleArgs/ConsoleArgs.csproj" />
</Solution>
17 changes: 17 additions & 0 deletions v2/rscg_examples/docopt.net/src/ConsoleArgs/ConsoleArgs.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="docopt.net" Version="0.8.1" />
</ItemGroup>
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
</Project>
2 changes: 2 additions & 0 deletions v2/rscg_examples/docopt.net/src/ConsoleArgs/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//Console.WriteLine(ConsoleArgs.ProgramArguments.Help);
Console.WriteLine(ConsoleArgs.ProgramArguments.Usage);
12 changes: 12 additions & 0 deletions v2/rscg_examples/docopt.net/src/ConsoleArgs/Program.docopt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Array 2 Any

Usage:
array_2_any.exe translate <text>
array_2_any.exe translatefile <nameFile>
array_2_any.exe (-h | --help)
array_2_any.exe --version

Options:
-h --help Show this screen.
--version Show version.
--verbose Show more output.
Loading