0

I have the following method in my class library that I want to hide from API documentation:

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. 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.
  • 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.

Any help would be greatly appreciated.

Mike Bruno
  • 600
  • 2
  • 9
  • 26

1 Answers1

0

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
Mike Bruno
  • 600
  • 2
  • 9
  • 26
  • Wouldn't this exclude every method called `CreateSomething`, regardless of which class it is declared on? –  Jan 27 '20 at 16:13
  • @Amy Yep. But again, when I fully-qualified the Method starting from the namespace, DocFX wouldn't recognize it as a match even though it clearly does match from a regex perspective. This is probably something I should bring up on the GitHub project page. – Mike Bruno Jan 28 '20 at 01:20