文档生成 – DocFX:为多个项目生成API文档

我正在开发一个解决方案中有多个项目的项目.我希望能够从外部目录生成文档,以保持应用程序代码文件夹清洁.当我尝试在docfx.json中设置src目录时,它似乎不喜欢绝对路径,也不喜欢相对路径.
{
  "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/**"
    ],"overwrite": [
  {
    "files": [
      "apidoc/**.md"
    ],"src":    "../../../Repos/Wsi.Extranet.CommonServices/Wsi.Extranet.CommonServices","dest": "_site","globalMetadataFiles": [],"fileMetadataFiles": [],"template": [
  "default"
],"postProcessors": [],"noLangKeyword": false
 }
}

它说它构建正常,但没有找到任何文件,它搜索的目录保留在当前目录中.

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)

当我尝试将相对路径放在files属性中时,我得到以下内容

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/**,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)

所以我的困惑似乎在于如何使用src选项.如果在元数据中使用src,那么似乎我无法指定文件和排除信息.我试图在与元数据相同的级别上使用src属性,但似乎什么也没做.

正如错误所述

../ is currently not supported in glob pattern

文件,排除等使用glob模式.通过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是构建多个项目的例子

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念
xml文件介绍及使用
xml编程(一)-xml语法
XML文件结构和基本语法
第2章 包装类
XML入门的常见问题(二)
Java对象的强、软、弱和虚引用
JS解析XML文件和XML字符串详解
java中枚举的详细使用介绍
了解Xml格式
XML入门的常见问题(四)
深入SQLite多线程的使用总结详解
PlayFramework完整实现一个APP(一)
XML和YAML的使用方法
XML轻松学习总节篇