scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.79k stars 1.04k forks source link

Unable to browse documentation offline #21197

Open coreyoconnor opened 1 month ago

coreyoconnor commented 1 month ago

Compiler version

Minimized code

  1. Download a javadoc jar: https://repo1.maven.org/maven2/com/lihaoyi/fansi_3/0.5.0/fansi_3-0.5.0-javadoc.jar
  2. Open index.html from jar (decompress to folder first)
  3. click a link in the left sidebar

Output

Nothing happens. The links do not change the content area.

Expectation

Expectation is documentation is usable offline. For some level of usable. Which should include the above case: Sidebar links change the content area.

Interestingly: The links do work if command-clicked - open in new tab.

Looks like there is a security failure loading the inkuire working when using the docs "offline" - via the file:// schema. Not when being served by a web server.

I rely on this for, well, ease of use really. No need to go searching for docs when they are all included in hte javadoc jar.

I assume offline file:// schema support as part of: https://github.com/glngn/sbt-alldocs

I cannot find an explicit statement that that javadoc html jars are usable directly, but that seems to be the norm.

KacperFKorban commented 1 month ago

For the documentation to work offline, you can simply host it yourself locally e.g. python3 -m http.server 8080.

You also pretty much always have the javadoc.io documentation available e.g. https://www.javadoc.io/doc/com.lihaoyi/fansi_3/latest/index.html Which is IMHO better, since you don't have to save and extract the jar (plus remember to delete it afterwards) and it takes just as much time to find (e.g. through scaladex).

coreyoconnor commented 1 month ago

Going to javadoc.io is not the same as using locally. Local does not require a network connection.

Running a web server is not great devex as well.

Keep in mind that automated tooling is downloading and extraction the jar. Creates doc library that is exactly the docs at the correct versions. Which is very easy even compared to searching on scaladex.

Scaladocs are the only docs i view locally that have this issue. Not a very good experience when everything else "just works"

On Tue, Jul 16, 2024, 13:41 Kacper Korban @.***> wrote:

For the documentation to work offline, you can simply host it yourself locally e.g. python3 -m http.server 8080.

You also pretty much always have the javadoc.io documentation available e.g. https://www.javadoc.io/doc/com.lihaoyi/fansi_3/latest/index.html Which is IMHO better, since you don't have to save and extract the jar (plus remember to delete it afterwards) and it takes just as much time to find (e.g. through scaladex).

— Reply to this email directly, view it on GitHub https://github.com/scala/scala3/issues/21197#issuecomment-2231791898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIMDN4A3RRTR2KCKWGXZDZMWAPNAVCNFSM6AAAAABK434OMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRG44TCOBZHA . You are receiving this because you authored the thread.Message ID: @.***>

coreyoconnor commented 1 month ago

As pointed out on discord: Right-click "open in new tab" and middle-click both work for the links as expected.

Seems like there can be a fallback to not loading the inkuire worker.

However, if a webserver is running and serving an aggregate of the inkuire databases (?). That would be better devex.

-Corey O'Connor @.***

On Tue, Jul 16, 2024 at 2:34 PM Corey O'Connor @.***> wrote:

Going to javadoc.io is not the same as using locally. Local does not require a network connection.

Running a web server is not great devex as well.

Keep in mind that automated tooling is downloading and extraction the jar. Creates doc library that is exactly the docs at the correct versions. Which is very easy even compared to searching on scaladex.

Scaladocs are the only docs i view locally that have this issue. Not a very good experience when everything else "just works"

On Tue, Jul 16, 2024, 13:41 Kacper Korban @.***> wrote:

For the documentation to work offline, you can simply host it yourself locally e.g. python3 -m http.server 8080.

You also pretty much always have the javadoc.io documentation available e.g. https://www.javadoc.io/doc/com.lihaoyi/fansi_3/latest/index.html Which is IMHO better, since you don't have to save and extract the jar (plus remember to delete it afterwards) and it takes just as much time to find (e.g. through scaladex).

— Reply to this email directly, view it on GitHub https://github.com/scala/scala3/issues/21197#issuecomment-2231791898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIMDN4A3RRTR2KCKWGXZDZMWAPNAVCNFSM6AAAAABK434OMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRG44TCOBZHA . You are receiving this because you authored the thread.Message ID: @.***>

KacperFKorban commented 1 month ago

Hmmm, I don't think that the inkuire error is related to the navigation issue. Scaladoc should work fine without any of the inkuire scripts loaded.

However, if a webserver is running and serving an aggregate of the inkuire databases (?). That would be better devex.

I'm not sure that I understand. Would you want scaladoc to download InkuireDB files from all its dependencies? Or would you want a global server of InkuireDB files for all libraries?

coreyoconnor commented 1 month ago

Hmmm, I don't think that the inkuire error is related to the navigation issue. Scaladoc should work fine without any of the inkuire scripts loaded.

However, if a webserver is running and serving an aggregate of the inkuire databases (?). That would be better devex.

I'm not sure that I understand. Would you want scaladoc to download InkuireDB files from all its dependencies? Or would you want a global server of InkuireDB files for all libraries?

Nevermind. That is not relevant to this bug report. Or at least the specific issue.