Scribble cross-references to user-scope libraries
dedbox opened this issue · comments
Exports from installation-scope packages link to docs.racket-lang.org, but exports from user-scope packages link to relative paths in the local filesystem.
Given a post in scribble format:
#lang scribble/manual
Title: scribble-xrefs
Date: 2018-10-08T14:37:03
Tags: scribble, xref
@(require (for-label event markdown/parse datalog data/enumerate))
Installation links:
datalog: @racket[make-theory]
data/enumerate: @racket[enum?]
User-specific, version-specific links:
event: @racket[bind]
markdown/parse: @racket[parse-markdown]
The links produced are, in order:
../../../home/eric/work/racket-event-lang/doc/event-lang/index.html#%28def._%28%28lib._event%2Fmain..rkt%29._bind%29%29
../../../home/eric/work/racket-event-lang/doc/event-lang/index.html#%28def._%28%28lib._event%2Fmain..rkt%29._bind%29%29
The first two are fine. The last two should be:
This appears to be a problem with how scribble interprets the --redirect-main
flag. I'm opening an issue for frog anyways, because this is where I first ran into the problem and it's not yet clear if there's a one-size-fits-all solution.
Matthew Flatt's message sounds to me like using --redirect
instead of (or in addition to??) --redirect-main
might work? Is that something you could try changing in private/read-scribble.rkt
?
Per mflatt's advice, adding --redirect https://docs.racket-lang.org/local-redirect/
to scribble flags in frog/private/read-scribble.rkt
pretty much works.
For maybe 1 second before the javascript kicks in, the Redirections page is shown with the following message:
This page is intended to redirect to the result of a search request. Since you’re reading this, it seems that the redirection did not work.
But the redirect does eventually point to the right page in docs.racket-lang.org.
The trailing slash on the --redirect URL is necessary, otherwise the browser stays on the Redirections page.
FTR- I left --redirect-main
in place, as is.
For future reference, the local-redirect mechanism is described in section 12.3 of the Package Management in Racket doc.