Skip to content

Scaladoc converts all relative links to html #11702

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

Closed
jodersky opened this issue Mar 11, 2021 · 4 comments · Fixed by #12043
Closed

Scaladoc converts all relative links to html #11702

jodersky opened this issue Mar 11, 2021 · 4 comments · Fixed by #12043
Assignees
Milestone

Comments

@jodersky
Copy link
Contributor

Compiler version

RC1

Minimized code

Any markdown that has a link to another local file. Scaladoc will always strip the extension and add '.html'. This results in invalid links if the original link points to other static files that will not be converted to html.

E.g. assume the following files:

foo.pdf
content.md

where content.md:

look at the documentation [here](foo.pdf)

Output

content.html will have a link to foo.html, which does not exist.

Expectation

content.html should have a link to foo.pdf

@BarkingBad
Copy link
Contributor

It's partially a bug. It should work when the resource indeed exists at given location. Otherwise there is a bug in fallback strategy, that assumes that it has to be link to the scala element (class, method, etc.) but it doesn't check whether that made up "class" or "method" actually exists.

On the other hand I think we didn't support yet copying static resources, so it will always fail for local elements, because it won't find them, therefore assume it is DRI link, will make .html extension and so on...

Nonetheless, we should fix the check (Locations.scala:84) and support local resources.

@jodersky
Copy link
Contributor Author

thanks for clarifying. What is a "DRI link"?

@BarkingBad
Copy link
Contributor

DRI is an identifier to formerly mentioned "class" or "method" or any other construct worth documenting. It name is inherited from dokka doctool, on which new scaladoc used to be based on. It stands for Dokka Resource Identifier. As for now, we removed dokka dependency (since it is too heavy for our needs), so the name can change in the near future.

@BarkingBad BarkingBad linked a pull request Apr 9, 2021 that will close this issue
@BarkingBad
Copy link
Contributor

Sorry for the long waiting time @jodersky

I added extra directory inside docs root directory called resources. The semantic is identical to images directory. Please place all your static resources like pdfs etc. under that directory and in code reference them by [here](/resources/foo.pdf)

@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants