Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocFx does not support /// <exclude /> #5796

Closed
ThomCBlackwellBSS opened this issue Apr 17, 2020 · 3 comments · Fixed by #9492
Closed

DocFx does not support /// <exclude /> #5796

ThomCBlackwellBSS opened this issue Apr 17, 2020 · 3 comments · Fixed by #9492
Labels
dotnet: xml-comment XML comment for .NET API reference docs dotnet Generate .NET API reference docs
Milestone

Comments

@ThomCBlackwellBSS
Copy link

ThomCBlackwellBSS commented Apr 17, 2020

Operation System:Windows

DocFX Version Used: Most recent

Template used: Default

Steps to Reproduce:

  1. added triple slash above a property "/
    /// <exclude />
    public string SomePropertyIDoNotWantDocumented { get; set; } = "";
    Expected Behavior:
    Property documentation would not be generated

Actual Behavior:
Property documentation is generated

@ThomCBlackwellBSS
Copy link
Author

Note the above window does not allow me to put the triple slash comment. It is the standard Exclude tag that GhostDoc adds when you select Exclude This from Documentation.

@balajirenganathan
Copy link

balajirenganathan commented Jul 22, 2020

I'm also facing the same issue, excluded public API's in the sources were generated in the output document. Any workaround and idea to resolve this?

/// <exclude />

@ThomCBlackwellBSS
Copy link
Author

ThomCBlackwellBSS commented Jul 22, 2020

Just saw your post balajirenganathan.

I agree DocFx should support Exclude. This is unnecessary extra and arcane work to support a common feature need (easily filter out items from generated end user documentation.

Here is what I ended up doing:
I put this attribute above anything I don't want to see in the documentation:
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]

(A custom attribute may be better for you -as this attribute is a standard one used for other things... but those other uses help me)

I set Filter in my docfx.json file
inside
"build": {
...
I set
"filter": "filter.yml",

Here is the part of my filter.yml that checks for that attribute.

apiRules:

  • exclude:
    uidRegex: ^System.Object
    type: Type
  • exclude:
    hasAttribute:
    uid: System.ComponentModel.EditorBrowsable

@yufeih yufeih added dotnet Generate .NET API reference docs dotnet: xml-comment XML comment for .NET API reference docs labels Dec 15, 2022
@yufeih yufeih added this to the Backlog milestone Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet: xml-comment XML comment for .NET API reference docs dotnet Generate .NET API reference docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants