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] .NET API / Markdown: Unresolved cref / xref tags from <summary> in generated markdown. #9879

Closed
Delsin-Yu opened this issue Apr 19, 2024 · 6 comments
Labels
bug A bug to fix dotnet Generate .NET API reference docs

Comments

@Delsin-Yu
Copy link

Describe the bug

The following XML Documentation:
image

does not resolve when converted to markdown, this is what appears in the GitHub.
image
image

In contrast, the generated website appears to resolve the links correctly:
image
image

Docfx.json

  • docfx.json config
{
	"rules": {
		"InvalidHref": "error"
	},
	"metadata": [
		{
			"src": [
				{
					"src": "GDViews.VirtualGridView",
					"files": [
						"**/*.csproj"
					]
				}
			],
			"dest": "Documentation",
			"filter": "filterConfig.yml",
			"outputFormat": "markdown",
			"disableGitFeatures": "true",
			"enumSortOrder": "declaringOrder"
		}
	]
}

Source Repo

The GDViews.VirtualGridView repo.

@Delsin-Yu Delsin-Yu added bug A bug to fix dotnet Generate .NET API reference docs labels Apr 19, 2024
@filzrev
Copy link
Contributor

filzrev commented Apr 19, 2024

does not resolve when converted to markdown, this is what appears in the GitHub.

Currently generated markdown files with "outputFormat": "markdown" option are intended to be used as docfx build command inputs.

So generated markdown files contains some docfx specific custom tags like <xref>.
And these custom tags are ignored by GitHub's markdown preview.

Raw view of generated file
https://raw.githubusercontent.com/Delsin-Yu/GDViews.VirtualGridView/main/Documentation/GodotViews.VirtualGrid.md


If there are no strict requirements for previewing the markdown file on GitHub.
Try to publish document to GitHub Pages

@Kevinf63
Copy link

Kevinf63 commented Apr 19, 2024

@Delsin-Yu and @filzrev, I similarly ran into this with "outputFormat": "markdown". I think a good live example of this issue is visible in DocFx's own cross referencing documentation:

Not sure if it's intentional or a mistake?
https://dotnet.github.io/docfx/docs/links-and-cross-references.html#more-options-for-cross-referencing-net-api-docs

<p>
  e.g.: 
  <code>
    [](xref:System.String?title=String+Class)
  </code>
   will be resolved as 
  <a href="xref:System.String?title=String+Class"></a>.
</p>

image

@filzrev
Copy link
Contributor

filzrev commented Apr 19, 2024

@Kevinf63
It seems xref is not resolved as expected on official docs.
(it's resolved by xrefService before but it's retired #9659)

I've created PR(#9880) to resolve xref resolver issue on conceptual documentation.

@filzrev
Copy link
Contributor

filzrev commented Apr 26, 2024

It seems resolved by publishing docs to GitHub pages.
And official docs xref problems are resolved by merged PR.

@Delsin-Yu
If there is no additional problems. Please close this issue.

@Delsin-Yu
Copy link
Author

There is a following issue when talking about resolving xrefs,, should I open a separate issue on it? Since it's not markdown-related.
image
https://delsin-yu.github.io/GDViews.VirtualGridView/api/GodotViews.VirtualGrid.DynamicGridViewers.html

@filzrev
Copy link
Contributor

filzrev commented Apr 26, 2024

There is a following issue when talking about resolving xrefs.

It seems be caused by #9677 issue.

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

No branches or pull requests

3 participants