You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/dotnet-api-docs.md
+42-34Lines changed: 42 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -154,45 +154,18 @@ To disable the default filtering rules, set the `disableDefaultFilter` property
154
154
155
155
To show private methods, set the `includePrivateMembers` config to `true`. When enabled, internal only langauge keywords such as `private` or `internal` starts to appear in the declaration of all APIs, to accurately reflect API accessibility.
156
156
157
-
There are two ways of customizing the API filters:
157
+
### The `<exclude />` documentation comment
158
158
159
-
### Custom with Code
159
+
The `<exclude />` documentation comment excludes the type or member on a per API basis using C# documentation comment:
160
160
161
-
To use a custom filtering with code:
162
-
163
-
1. Use docfx .NET API generation as a NuGet library:
The filter callbacks takes an [`ISymbol`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.isymbol?view=roslyn-dotnet) interface and produces an [`SymbolIncludeState`](../api/Docfx.Dotnet.SymbolIncludeState.yml) enum to choose between include the API, exclude the API or use the default filtering behavior.
185
-
186
-
The callbacks are raised before applying the default rules but after processing type accessibility rules. Private types and members cannot be marked as include unless `includePrivateMembers` is true.
187
-
188
-
Hiding the parent symbol also hides all of its child symbols, e.g.:
189
-
- If a namespace is hidden, all child namespaces and types underneath it are hidden.
190
-
- If a class is hidden, all nested types underneath it are hidden.
191
-
- If an interface is hidden, explicit implementations of that interface are also hidden.
192
-
193
-
### Custom with Filter Rules
166
+
### Custom filter rules
194
167
195
-
To add additional filter rules, add a custom YAML file and set the `filter` property in `docfx.json` to point to the custom YAML filter:
168
+
To bulk filter APIs with custom filter rules, add a custom YAML file and set the `filter` property in `docfx.json` to point to the custom YAML filter:
196
169
197
170
```json
198
171
{
@@ -265,3 +238,38 @@ apiRules:
265
238
```
266
239
267
240
Where the `ctorArguments` property specifies a list of match conditions based on constructor parameters and the `ctorNamedArguments` property specifies match conditions using named constructor arguments.
241
+
242
+
243
+
### Custom code filter
244
+
245
+
To use a custom filtering with code:
246
+
247
+
1. Use docfx .NET API generation as a NuGet library:
The filter callbacks takes an [`ISymbol`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.isymbol?view=roslyn-dotnet) interface and produces an [`SymbolIncludeState`](../api/Docfx.Dotnet.SymbolIncludeState.yml) enum to choose between include the API, exclude the API or use the default filtering behavior.
269
+
270
+
The callbacks are raised before applying the default rules but after processing type accessibility rules. Private types and members cannot be marked as include unless `includePrivateMembers` is true.
271
+
272
+
Hiding the parent symbol also hides all of its child symbols, e.g.:
273
+
- If a namespace is hidden, all child namespaces and types underneath it are hidden.
274
+
- If a class is hidden, all nested types underneath it are hidden.
275
+
- If an interface is hidden, explicit implementations of that interface are also hidden.
0 commit comments