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

[Bug] Cross-reference from markdown to member functions only works when the function has no arguments #9312

Closed
TIS-Tim opened this issue Oct 19, 2023 · 2 comments
Labels
bug A bug to fix

Comments

@TIS-Tim
Copy link

TIS-Tim commented Oct 19, 2023

Describe the bug*
Cross-reference from markdown to member functions seems to only work for parameterless functions, e.g.

Link to `Class1.g`: [g](xref:ClassLibrary1.Class1.g)

works and correctly links to ClassLibrary1.Class1.g() while

Link to `Class1.f`: [f](xref:ClassLibrary1.Class1.f)

Link to `Class1.f(int)`: [f(int)](xref:ClassLibrary1.Class1.f(int))

both don't link to ClassLibrary1.Class1.f(int).

Linking from inside the API documentation (<see cref="ClassLibrary1.Class1.f(int)"/>, <see cref="ClassLibrary1.Class1.g()"/>) works fine.

To Reproduce
Steps to reproduce the behavior:
Run docfx in the docfx_project directory of my test project:
https://github.com/TIS-Tim/docfx-markdown-cross-reference

Expected behavior
Generate correct links when cross-referencing API documentation from markdown.

Context

  • OS: Windows
  • Docfx version: 2.71.1+f5c0285f6a8571fbe1fe219e95b2f9add02c732c
@TIS-Tim TIS-Tim added the bug A bug to fix label Oct 19, 2023
@yufeih
Copy link
Contributor

yufeih commented Oct 19, 2023

The xref syntax works a bit differently than cref. This should work: [](xref:ClassLibrary1.Class1.f(System.Int32)).

You can find the correct syntax by searching for uid: in the generated YAML files.

@yufeih yufeih closed this as completed Oct 19, 2023
@TIS-Tim
Copy link
Author

TIS-Tim commented Oct 19, 2023

@yufeih

Thank you!

You are totally right. The cross-referencing tool obviously doesn't know the C#-specific aliases of the .net types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix
Projects
None yet
Development

No branches or pull requests

2 participants