【问题标题】:DocFx reference markdown different projectDocFx 参考 markdown 不同项目
【发布时间】:2019-06-14 07:11:07
【问题描述】:

我们正在开发一个多项目 *.sln 解决方案,并且可以在单独的 Asp.Net Web csproj 中使用 DocFx 为它成功生成带有 *.md 文章的 API 文档,仅用于文档。

但是我们想在单个 *.csproj 项目中维护和引用本地 Markdown *.md 文章和图像,并在全局文档站点中引用和重用它们,但不知何故,我们只能从Web.csproj 中的 /articles 文件夹。

这是当前的docfx.json。如您所见,我们正在尝试引用来自不同项目的图像和降价文件

“../Generator/MyDocService.Contracts/**.png”,以及

"../Generator/MyDocService.Contracts/*.md",

但它们都没有出现在我们的“obj”或“_site”文件夹中。

{
  "metadata": [
    {
      "src": [
        {
          "files": [
            "*.csproj"
          ],
          "src": "../Generator/GenBasics",
          "exclude": [
            "**/obj/**",
            "**/bin/**",
            "_site/**"
          ]
        },
        {
          "files": [
            "*.csproj"
          ],
          "src": "../DocFrameworkCore/GenCore",
          "exclude": [
            "**/obj/**",
            "**/bin/**",
            "_site/**"
          ]
        },
        {
          "files": [
            "*.csproj"
          ],
          "src": "../Generator/GenImpl",
          "exclude": [
            "**/obj/**",
            "**/bin/**",
            "_site/**"
          ]
        },
        {
          "files": [
            "*.csproj"
          ],
          "src": "../DocFrameworkCore/GenCoreBasics",
          "exclude": [
            "**/obj/**",
            "**/bin/**",
            "_site/**"
          ]
        },
        {
          "files": [
            "*.csproj",
            "**.md",
            "**.png"
          ],
          "src": "../Generator/MyDocService.Contracts",
          "exclude": [
            "**/obj/**",
            "**/bin/**",
            "_site/**"
          ]
        }
      ],
      "filter": "filterConfig.yml",
      "dest": "obj/api"
    }
  ],
  "build": {
    "content": [
      {
        "files": [
          "api/**.yml"
        ],
        "cwd": "obj"
      },
      {
        "files": [
          "api/*.md",
          "articles/**.md",
          "../Generator/MyDocService.Contracts/*.md",
          "toc.yml",
          "*.md"
        ],
        "exclude": [
          "obj/**",
          "_site/**"
        ]
      }
    ],
    "resource": [
      {
        "files": [
          "../Generator/MyDocService.Contracts/**.png",
          "images/**"
        ],
        "exclude": [
          "obj/**",
          "_site/**"
        ]
      }
    ],
    "overwrite": [
      {
        "files": [
          "apidoc/**.md"
        ],
        "exclude": [
          "obj/**",
          "_site/**"
        ]
      }
    ],
    "dest": "_site",
    "globalMetadata": {
      "_appTitle": "MyDoc API",
      "_appFooter": "",
      "_appLogoPath": "images/My.png",
      "_appFaviconPath": "favicon.ico",
      "_enableSearch": true,
      "_disableContribution": true
    },
    "template": [
      "default",
      "docfx-tmpl/src"
    ]
  }
}

【问题讨论】:

    标签: markdown documentation-generation xml-documentation docfx


    【解决方案1】:

    我可以制作分布式 *.md 文件的唯一方法 所有可用的子项目是将docfx.json 放在解决方案的根目录中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-07
      • 1970-01-01
      相关资源
      最近更新 更多