racket / scribble

Other
197 stars 90 forks source link

manual-racket.js accesses https://pkgs.racket-lang.org/pkg/<package-name>.json for local documentation #299

Closed SuzanneSoy closed 3 years ago

SuzanneSoy commented 3 years ago

The network tab of my browser shows that when the documentation for a locally-installed package is loaded, it accesses https://pkgs.racket-lang.org/pkg/.json (e.g. the docs for anaphoric at file:///home/suzanne/.local/share/racket/8.0/pkgs/anaphoric/doc/anaphoric/index.html access https://pkgs.racket-lang.org/pkg/anaphoric.json).

Local documentation should work 100% offline and shouldn't attempt to make network requests.

samth commented 3 years ago

This enables the automatic linking to the source of the document. If you click the title of the document, it includes a link to the source of the document. That source is computed by looking up the package info from the package server, by requesting that JSON file.

Note that everything works fine even if that network request fails, it just won't show the link.

SuzanneSoy commented 3 years ago

Can't this be burned into the HTML file when the scribble file is compiled?

samth commented 3 years ago

That information is usually not available when the HTML is generated -- for example, if you install from a catalog that isn't pkgs.racket-lang.org or if you don't have network access available, both of which are true for pkg-build.racket-lang.org which is what generates the docs on docs.racket-lang.org.

If you want to try implementing this in a different way, I'd be happy to look at that or provide advice, but I don't immediately have other suggestions on-hand.

SuzanneSoy commented 3 years ago

I see. I'll close this then :)