Skip to content

[Bug] Relative Links to docfx.json file using ~ and relative paths are filed as invalid, not able to resolve code-csharp markup #10746

@DevTKSS

Description

@DevTKSS

Describe the bug
A clear and concise description of what the bug is.

All tilde (~) using relative to docfx.json meant links are filed as invalid
the problems with this is in my opinion, for those of us Users where the docfx.json file is positioned at doc/ path of our repository, like me or also docfx themself, and might use folder links, e.g.:

- [Explore the sourcecode](~/../src/SomeFolderName/)

as alternative to 4 or more ../ in a row if the markdown file might be nested so deep because your docs might be larger and structured
Which is indeed did what I did set the links to and still they are failing to resolve! so both seem to not work? what is the problem its facing I might doing wrong?

or [!code-csharp[](~/../src/SomeFolderName/SomeFileName which MIGHT be replace able with codeBasePath, but as I was looking this up here: https://dotnet.github.io/docfx/reference/docfx-json-reference.html#codesourcebasepath

I as reader am defintly confused about the there suggested code reference syntax, so I am not sure that this is what we would expect it to be?

Current state I am getting, is about 170 warnings 😵‍💫 and as I was clicking with "ctrl + click" on the "invalid" stated link, vs code had no problem at all to navigate to the locations accordingly!

To Reproduce
Steps to reproduce the behavior:

  1. use Repo: DevTKSS/DevTKSS.Uno.SampleApps@9f3202c
  2. docfx metadata doc/docfx.json will show InvalidCref and Badly formed CML comment which did not lint as faulted in vs 2022, then instead did lint if putting the immutableList inside of the task
  3. docfx build doc/docfx.json will list you tonns of warnings about duplicated files, and not found uid references

Expected behavior
A clear and concise description of what you expected to happen.

  • codebasePath should match the Markdown page in the docs
  • both ways to link should be valid, with (=> relativ to file) or without ~ (=> relativ to docfx.json)
  • metadata should be usable and correctly resolve using code-csharp ref

Context (please complete the following information):

  • OS: Windows 11
  • Docfx version: 2.78.3+850a61c2ecb83b0bda21448f1393e480934556fd

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions