DocFX: creating API documentation for multiple projects

I am working on a project with several projects in solution. I would like to be able to generate documentation from an external directory to keep application code codes clean. When I try to set the src directory in my docfx.json, this does not seem to match the absolute paths and not the relative paths.

{ "metadata": [{ "src": [{ "files": ["../../../Repos/Wsi.Extranet.CommonServices/Wsi.Extranet.CommonServices/**/*.csproj"] "exclude": [ "**/obj/**", "**/bin/**", "_site/**" ] }], "dest": "api" }], "build": { "content": [ { "files": [ "api/**.yml", "api/index.md" ] }, { "files": [ "articles/**.md", "articles/**/toc.yml", "toc.yml", "*.md" ], "exclude": [ "obj/**", "_site/**" ] } ], "resource": [ { "files": [ "images/**" ], "exclude": [ "obj/**", "_site/**" ] } ], "overwrite": [ { "files": [ "apidoc/**.md" ], "exclude": [ "obj/**", "_site/**" ] } ], "src": "../../../Repos/Wsi.Extranet.CommonServices/Wsi.Extranet.CommonServices", "dest": "_site", "globalMetadataFiles": [], "fileMetadataFiles": [], "template": [ "default" ], "postProcessors": [], "noLangKeyword": false } } 

It says that it is built perfectly, but did not find the files, and the directory it is looking for is in the current directory.

 D:\temp\WsiApiDocs\docfx_project>docfx metadata Info: Config file docfx.json found, start generating metadata... Info: No files are found with glob pattern **/*.csproj, excluding **/obj/**,**/bin/**,_site/**, under directory "D:\temp\WsiApiDocs\docfx_project" Info: Completed executing in 54.0087 milliseconds. Build succeeded. 0 Warning(s) 0 Error(s) 

When I try to put the relative path in the files property, I get the following:

 D:\temp\WsiApiDocs\docfx_project>docfx metadata Info: Config file docfx.json found, start generating metadata... Info: No files are found with glob pattern ../../../Repos/Wsi.Extranet.CommonServices/Wsi.Extranet.CommonServices/**/*.csproj, excluding **/obj/**,**/bin/**,_site/**, under directory "D:\temp\WsiApiDocs\docfx_project" **Warning: NOTE that `../` is currently not supported in glob pattern, please use `../` in `src` option instead.** Info: Completed executing in 48.9621 milliseconds. Build succeeded with warning. Warning: NOTE that `../` is currently not supported in glob pattern, please use `../` in `src` option instead. 1 Warning(s) 0 Error(s) 

So my confusion seems to be how to use the src parameter. If you use src in the metadata, then it seems like I cannot provide information about the file and the exception. I tried using the src property at the same level as the metadata, but it did nothing.

+5
source share
1 answer

Just as the error contains

../ not currently supported in the glob template

files , exclude etc. use glob templates. Instead of the base directory, enter src :

 { "metadata": [ { "src": [ { "files": "Repos/Wsi.Extranet.CommonServices/Wsi.Extranet.CommonServices/**.csproj", "exclude": [ "**/obj/**", "**/bin/**" ], "src": "../../.." // <---- base directory } ], "dest": "api" } ], "content": [ { "files": [ "api/**.yml", "api/index.md" ] } // ... ] } 

Here is an example of structuring multiple projects.

+11
source

Source: https://habr.com/ru/post/1260719/


All Articles