https://github.com/feast107/jsoncomment
Auto generate json document with comments using attributes
https://github.com/feast107/jsoncomment
autogenerated comments csharp json netstandard20 sourcegenerator
Last synced: 2 months ago
JSON representation
Auto generate json document with comments using attributes
- Host: GitHub
- URL: https://github.com/feast107/jsoncomment
- Owner: feast107
- License: mit
- Created: 2023-02-26T17:34:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-05T12:35:38.000Z (almost 3 years ago)
- Last Synced: 2025-01-18T14:54:48.753Z (about 1 year ago)
- Topics: autogenerated, comments, csharp, json, netstandard20, sourcegenerator
- Language: C#
- Homepage:
- Size: 413 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JsonComment
能够通过注解自动生成文档注释的基于 `.NET Standard 2.0` 的代码分析器
:construction: :construction: **施工中注意——仍有bug** :construction: :construction:
# Effect:

# Start
+ 引用程序集之后添加为
```json
OutputItemType="Analyzer"
```
``` xml
```
由于需要引用包中的内容,请忽略 `ReferenceOutputAssembly` 项或将其置为 `true`
``` json
ReferenceOutputAssembly="true"
```
+ 在你需要生成注释的类型上添加 `JsonComment`
``` c#
using Feast.JsonComment;
[JsonComment]
public partial class MyModel{
public int Id { get; init; }
public string Name { get; set; }
}
```
+ :warning: **类型需要携带 `partial` 关键字**
+ :warning: **类型的其他注释将会覆盖该注释**
+ :ok_hand: 本程序集不会对任何类型进行增改
+ 在你的程序中调用 `JsonComment.Generate()`
``` c#
internal class Program
{
static void Main(string[] args)
{
JsonComment.Generate();
}
}
```
文档将会生成在类型声明文件所在的目录下,目录下批量的源文件会整合到一个文档文件中
# Preview
+ :grey_exclamation: 泛型<>
+ :construction: 初始值项的设定
+ :construction: 如果尽可能的避免生成外部文档,但这会要求在分析时生成JSON数据,以及继承关系分析上的困难