documentation-generationdocfx

How to generate documentation for other projects within solution using DocFx


I am using DocFx to automatically generate documentation in Visual Studio 2015.

Per the Getting Started instructions, I added an empty ASP.NET 4 Web Application and used the Nuget Console to install the DocFx build package (e.g. Install-Package docfx.msbuild). I built the site and it it generated documentation for code within the project.

I was wondering how to configure docfx.json to get DocFx to document code in other projects within the solution.


Solution

  • In docfx.json, there is an array of metadata. The example metadata has a src object with files and exclude properties.

    To point to another project in your solution, add a cwd property to metadata and change folders (i.e. "../Another.Project").

    {
      "metadata": [
        {
          "src": [
            {
              "files": [ "**/*.csproj" ],
              "exclude": [ "**/bin/**", "**/obj/**", "_site/**" ],
              "cwd": "../Another.Project"
            }
          ],
          "dest": "obj/api"
        }
      ],
      "build": ...
    }