简体   繁体   English

DocFX - 无法从 API 文档中过滤掉公共方法

[英]DocFX - Unable to filter out public Method from API Documentation

I have the following method in my class library that I want to hide from API documentation:我的类库中有以下方法,我想从 API 文档中隐藏它:

namespace com.contoso.myns
{
    public class myclass
    {
        public static string CreateSomething()
        {
            //Do Stuff
        }
    }
}

I followed the DocFX Tutorial for filtering API documentation to create filterConfig.yml .我按照DocFX 教程过滤 API 文档来创建filterConfig.yml In that file I have the following:在该文件中,我有以下内容:

- exclude:
    uidRegex: '^com\.contoso\.myns\.myclass\.Create[^.]+$'
    type: Method

However, the method is still appearing in my documentation.但是,该方法仍然出现在我的文档中。

Please note:请注意:

  • I have other filters defined in filterConfig.yml which are working as-expected, so the file is being picked up and properly parsed by DocFX.我在filterConfig.yml中定义了其他过滤器,它们按预期工作,因此文件被 DocFX 拾取并正确解析。
  • I tested the regex pattern (^com.contoso.myns.myclass.Create[^.]+$) using this regex tester and it does match the fully-qualified name of the method I want to exclude.我使用此正则表达式测试器测试了正则表达式模式 (^com.contoso.myns.myclass.Create[^.]+$),它确实与我要排除的方法的完全限定名称匹配。

Any help would be greatly appreciated.任何帮助将不胜感激。

The pattern to match a method name shouldn't contain the entire path from the namespace;匹配方法名称的模式不应包含命名空间中的整个路径; just the method name itself:只是方法名称本身:

- exclude:
    uidRegex: 'CreateSomething$'
    type: Method

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM