You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This greatly aids traversing the documentation: readers of this module's
make-cookie can now jump to the documentation of the wrapped function
instead of jumping to net/cookies/server and scrolling or searching.
One possible solution is to prefix the special name like
"net:make-cookie": the only downside is that the link will display as
"net:make-cookie" instead of "make-cookie"; see the GUI Easy
documentation [1] as an example (e.g., "gui:dc<%>" in "Custom Views").
In that document, all racket/gui exports are prefixed with gui: to avoid
ambiguity, and the links take you to the correct place within racket/gui
documentation. That is accomplished by
(require (for-label (prefix-in gui: racket/gui)))
which I wanted to avoid here: I didn't want all references to
net/cookies/server to use the net: prefix, and it is desirable for the
docs to show "make-cookie".
Thus instead we use a trick (by way of Sorawee and Matthew Flatt) to
embed the require-for-label in a macro use [2].
[1]: https://docs.racket-lang.org/gui-easy/index.html
[2]: https://github.com/racket/racket/blob/f2294a69784a5e77e83d8cf07d6cddab7f1b09fd/pkgs/racket-doc/syntax/scribblings/module-reader.scrbl#L10
0 commit comments