-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Scaladoc reports broken links that aren't broken #16695
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
Comments
Thinking about it some more, perhaps the front matter directives should be extended to include import statements? Also, full support for |
Hey @Dedelweiss I saw you opened a PR about this, but I figured it might be a good idea to discuss here a bit first because I have a few question that might help with the context for review.
Wouldn't we want to include the full classpath though? For example what happens in we have both a
Just to be clear, we're talking about |
I agree that we should include the full classpath. I think it is fine to require a fully qualified name in static pages, but we may consider introducing a setting to set a package prefix if there is a high demand for it. |
In this PR: I change the regular path from `../exception/scala/Foo.html` to `exception.scala.Foo` to use the DRI resolver function. ## Context: I have a Hello World project with a `Foo` class and a `Foo2` object within a package `exception.scala` <img width="225" alt="Screenshot 2023-06-07 at 12 45 47" src="https://github.com/lampepfl/dotty/assets/44496264/1d155f81-5910-44b4-be0c-b495cd75e597"> ### Example 1 (No warning): <img width="500" alt="Screenshot 2023-06-07 at 15 38 07" src="https://github.com/lampepfl/dotty/assets/44496264/cf341967-8743-480a-9f35-7c27ed78a691"> ### Result: <img width="800" alt="Screenshot 2023-06-07 at 12 50 13" src="https://github.com/lampepfl/dotty/assets/44496264/ccea1646-3501-4ad2-b9d0-ee5d8bbac969"> As you can see, as expected there is no warning for these links. ### Example 2 (Warnings): <img width="500" alt="Screenshot 2023-06-07 at 15 41 00" src="https://github.com/lampepfl/dotty/assets/44496264/9309a851-24d6-472e-839e-444c0dc58bb6"> ### Result: <img width="800" alt="Screenshot 2023-06-07 at 15 41 13" src="https://github.com/lampepfl/dotty/assets/44496264/1b8986f9-d06c-4eda-9599-e4f2cc0343f7"> Fixes: #16695
In this PR: I change the regular path from `../exception/scala/Foo.html` to `exception.scala.Foo` to use the DRI resolver function. ## Context: I have a Hello World project with a `Foo` class and a `Foo2` object within a package `exception.scala` <img width="225" alt="Screenshot 2023-06-07 at 12 45 47" src="https://github.com/lampepfl/dotty/assets/44496264/1d155f81-5910-44b4-be0c-b495cd75e597"> ### Example 1 (No warning): <img width="500" alt="Screenshot 2023-06-07 at 15 38 07" src="https://github.com/lampepfl/dotty/assets/44496264/cf341967-8743-480a-9f35-7c27ed78a691"> ### Result: <img width="800" alt="Screenshot 2023-06-07 at 12 50 13" src="https://github.com/lampepfl/dotty/assets/44496264/ccea1646-3501-4ad2-b9d0-ee5d8bbac969"> As you can see, as expected there is no warning for these links. ### Example 2 (Warnings): <img width="500" alt="Screenshot 2023-06-07 at 15 41 00" src="https://github.com/lampepfl/dotty/assets/44496264/9309a851-24d6-472e-839e-444c0dc58bb6"> ### Result: <img width="800" alt="Screenshot 2023-06-07 at 15 41 13" src="https://github.com/lampepfl/dotty/assets/44496264/1b8986f9-d06c-4eda-9599-e4f2cc0343f7"> Fixes: #16695 [Cherry-picked 2d9eb1c]
Scaladoc version 3.2.1 -- Copyright 2002-2022, LAMP/EPFL
If a relative link is put in to a static doc which references the generated docs, it is incorrectly reported as broken. The link in the output works fine however.
What's really needed is a proper way of referencing the generated class documentation from static doc files without including the entire class path, e.g.
[[SomeClass]]
rather than[[foo.bar.SomeClass]]
. In fact the support for[[ ... ]]]
references in static docs seems mostly broken,The text was updated successfully, but these errors were encountered: