【问题标题】:DocFX filter specific ClassesDocFX 过滤器特定类
【发布时间】:2023-02-24 04:14:50
【问题描述】:

我真的是 DocFx 的新手,我无法过滤项目中的某些特定类。

这是文档.json:

{
  "metadata": [
    {
      "src": [
        {
          "files": ["**.dll"],
          "src": "../X3_Models/bin/Release/net7.0"
        }
      ],
      "dest": "api",
      "includePrivateMembers": false,
      "disableGitFeatures": false,
      "disableDefaultFilter": false,
      "namespaceLayout": "flattened",
      "filter": "filterConfig.yml"
    }
  ],

过滤配置.yml:

apiRules:
- exclude:
  uidRegex: TaskNotifier

我正在使用 CommunityToolkit.Mvvm,该工具包为从 [ObservableObject] 继承的每个类生成两个额外的类。

例如:

public class X3_Models.X3ProductModel

public class X3_Models.X3ProductModel.TaskNotifier
public class X3_Models.X3ProductModel.TaskNotifier<T>

我想在我的文档中避免所有包含 TaskNotifier 的类。

谢谢。

【问题讨论】:

    标签: docfx


    【解决方案1】:

    我已经能够通过使用 typeuidRegex 的组合来解决它:

    apiRules:
    - include:
        type: Interface
    - exclude:
        uidRegex: TaskNotifier
        type: Class
    

    我想知道是否有更好的解决方案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-02
      • 1970-01-01
      • 2011-11-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多