greghendershott / frog

Frog is a static blog generator implemented in Racket, targeting Bootstrap and able to use Pygments.
916 stars 96 forks source link

Scribble sources: Point user-scope xrefs to local-redirect. Closes #229 #231

Closed dedbox closed 5 years ago

dedbox commented 5 years ago

By default, scribble resolves cross-refereces into packages installed locally, in user-scope, to local filesystem paths. This is not so useful for rendering a blog. Instead, all links should point into the official Racket docs server.

This patches the default behavior to make all cross-references into non-main packages point to https://docs.racket-lang.org/local-redirect/.

The trailing forward slash is important, otherwise the browser stays on a generic "Redirections" page indicating the redirect failed.

See https://docs.racket-lang.org/pkg/implementation.html section 12.3 for an overview of the local-redirect mechanism.

dedbox commented 5 years ago

This seems generally useful, so here's a PR in case you agree. Feel free to discard if not.

greghendershott commented 5 years ago

Thank you!!