Inline <seealso> not populating "See Also" section
Inline <seealso> does not populate the "See Also" section
Functional impact
The reference won't appear in the "See Also" section.
Minimal repro steps
Using docfx v2.20:
public class PopulatesSeeAlso
{ }
public class DoesNotPopulateSeeAlso
{ }
/// <summary>
/// Also see <seealso cref="DoesNotPopulateSeeAlso"/>.
/// </summary>
/// <seealso cref="PopulatesSeeAlso"/>
public sealed class Test
{ }
Expected result
All <seealso> tags should appear in the "See Also" section, even if they are located inside a top-level tag, such as <summary>.
Actual result
A top-level <seealso> tag works as expected, but a <seealso> tag appearing inside e.g. a <summary> tag will only appear in the "Summary" section, it won't (by itself) create a "See Also" section and it won't appear in the "See Also" section.
It is by design. Only stand alone see also creates See Also section.
The current design means:
- An inline
<see>does exactly the same thing as an inline<seealso>, so currently there's no reason to ever use an inline<seealso> - One often has to add both an inline
<see>tag and a stand-alone<seealso>tag for the same reference, which is extra unnecessary code - Having the
<seealso>tag not populating the "See Also" section under certain circumstances is very unintuitive
Feature Request
Please revise <seealso> to always populate the "See Also" section.
Thanks, Kristian
Is this something one could customize by some template? I see this issue is quite old, but it still stands afaik.
cc @herohua
Judging from the DocFX v2 source code, I think the feature could be implemented like this:
- Change the XPath selector to "/member//seealso" in the TripleSlashCommentModel.GetSeeAlsos method. https://github.com/dotnet/docfx/blob/56250e19a7fa546abb7c76d5ae4041c528bc4c2b/src/Microsoft.DocAsCode.Metadata.ManagedReference.Common/Parsers/TripleSlashCommentModel.cs#L258-L266
- Document in triple_slash_comments_spec.md that non-toplevel
seealsotags are now transformed both to metadata and to HTML tags. - Make TripleSlashParserUnitTest.cs test that it works.
TripleSlashCommentTransform.xsl would not have to be changed.