C# API documentation automatic generator

Article directory

Preface

Recently, when I want to communicate with others, I have to provide API documents. However, I feel that manually writing API documents is a bit troublesome. I am thinking about how to generate automatic API documents.

Sandcastle

I've been tinkering with it for two hours, but it doesn't seem to work very well.

Microsoft open source new document generation tool DocFX

Insert image description here

DocFX

Since it’s not easy to use, then switch to DocFX.

.NET6 uses DOCFX to automatically generate development documents based on comments

docfx is a simple tool to use and automatically generate directories.

I don’t know why I get an error when I run docfx init -q

Insert image description here

After struggling for a long time, it finally came out, right?
I feel the effect is very poor

{
    
    
  "metadata": [
    {
    
    
      "src": [
        {
    
    
        //这个就是你的src文件路径
          "src": "src",
          //这个是你生成的解决方案的dll
          "files": [
            "ConsoleApp1.dll"
          ]
        }
      ],
      "dest": "api"
    }
  ],
  "build": {
    
    
    "content": [
      {
    
    
        "files": [
          "api/*.yml"
        ],
        "exclude": [
          "_site/**"
        ]
      }
    ],
    "resource": [
      {
    
    
        "files": [
          "images/**"
        ]
      }
    ],
    "output": "_site",
    "template": [
      "default",
      "modern"
    ],
    "globalMetadata": {
    
    
      "_appName": "mysite",
      "_appTitle": "mysite",
      "_enableSearch": true,
      "pdf": true
    }
  }
}

Insert image description here

Git warehouse address gclove2000/Docfx_Test

Guess you like

Origin blog.csdn.net/qq_44695769/article/details/134684276