Commit 87a1e58
docs: link to wrapped make-cookie
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#L101 parent 723fab4 commit 87a1e58
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
457 | 464 | | |
458 | 465 | | |
459 | 466 | | |
| |||
474 | 481 | | |
475 | 482 | | |
476 | 483 | | |
477 | | - | |
| 484 | + | |
478 | 485 | | |
479 | 486 | | |
480 | 487 | | |
| |||
0 commit comments