Links to other parts of scaladoc-documentation not working

When running scala-cli doc . -o api it generates the expected folder containing the documentation-website, however when opening the index.html file in a web-browser I cannot open links to other parts of the documentation by simply clicking on them. The strange thing is that it works as expected when hovering over a link, and selecting “Open in a new tab”.

Another issue is that the links to other parts under the Value members and Type members sections are linking to, which of course simply yields a page not found response.

Opening a server with python3 -m http.server in the api directory does solve the links in the tree not working, but the links to remain.

Could someone please explain how to compile the documentation using scala-cli to fix the issues described above (without running opening a server if possible)?


I had the same issue while testing scaladoc locally. I did not track down the issue with local links, but I’m chiming in with moral support. “Shouldn’t this just work?”

1 Like

Yeah, I agree, it should “Just Work” ™. There are two issues here: 1) The defaults should be set so that it works out of the box. And 2) There should better docs to help understand how to set the parameters to scaladoc via scala-cli, as there is not much info nor examples here: Doc | Scala CLI

I have tried to find ways to do this but still wonder:

How to forward the right options to scaladoc via scala-cli so that all links in the static site generated works using the local file system via my local browser (if possible?)?

It should work, but it doesn’t :smile:
Until it does work running the following from inside the documentation folder should do the trick:

1 Like

Thank you! This fixed both issues.

This is cool! Thanks for your patch! @dixine55

Really good that you also contributed with an issue:

I suggest that you add a permissive OSS licence to your repo (if that is your intent). Preferably Apache 2.0 so it is compliant with the scala dotty repo license…

I wasn’t entirely sure what all the different licenses meant and assumed it was like patents, but sounds like it’s the opposite :sweat_smile:

Thanks for the notice, added the Apache 2.0 license now as it’s meant to be used freely :+1:

1 Like