-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kind information to the index #328
base: master
Are you sure you want to change the base?
Conversation
This depends on racket/scribble#328
This depends on racket/scribble#328 and will be effectively used by racket/racket#4263
How about |
How does this fit with the |
I didn't modify that at all, so they are completely unaffected. An |
How about I don't want to |
Oh, another possibility is to create |
I think if we're now using the |
By the way, I switched to |
It is already the case that |
I'm thinking that I'd like the new index entries I added for match (eg app) to mention match in the search results. |
Perhaps we want to keep track of three information:
For example, a method would have By default, |
This PR creates new index types that contain the kind information. This allows e.g. the search page to display or refine the query based on the information. Only `form-index-desc`, `procedure-index-desc`, and `thing-index-desc` are considered, because they are the only ones that currently allow kind customization. Other indices are already too specific (e.g. `mixin`, `struct`), so there seems to be no point to allow customization in such cases. On the other hand, newer forms that need the kind customization probably should just use `thing-index-desc(*)`, similar to how the Rhombus documentation is currently doing. To maintain backward compatability, the kind information is not added to any existing structs. Instead, new index types are created at the leaf level of the index hierarchy. It's unclear what the contract of the kind information should be. Currently, it is `string?`. Here are some other possibilities - `(or/c string? #f)`: this allows the information to be left out. However, I think that anything indexed with form, proc, or thing should mandate the kind information, because they default to "syntax", "procedure", or "value", so they are already non-empty. If one wishes to leave the information out, they can use `exported-index-desc` directly (this is what the `syntax/parse` library does). - `xexpr?`: this allows richer encoding. In particular, `method-index-desc` currently displays information like "get-admin (method of editor<%>)" on the search page. This "(method of editor<%>)" is ad-hoc inserted and "editor%" is typeseted differently than "method of". The idea of `xexpr?` is to make it general enough to typeset "(method of editor<%>)" under one single framework, without special-casing `method-index-desc` and also allow this flexible customization for non-methods. On the other hand, allowing `xexpr?` could introduce vulnerabilities like HTML injection. We could constrain it, but that seems like too much work. So I think continuing to special-casing `method-index-desc` might be better. Therefore, I'm sticking with `string?` for now, until we figure out a better solution. However, it should be noted that further modification will risk breaking backward compatibility. Also bump the version, to be used for `#:version` in other `info.rkt`
This pull request has been mentioned on Racket Discussions. There might be relevant details there: https://racket.discourse.group/t/rfc-hash-table-pattern-matching/1686/59 |
This PR creates a new index description
exported-index-desc*
that contain the kind information.This allows e.g. the search page to display or refine the query
based on the information.
To maintain backward compatibility, the kind information is not added to
any existing structs. Instead, a new index type is created.
The contract for the kind field is
(listof string? (list/c 'code string?))
.This rich encoding allows typesetting search results like https://docs.racket-lang.org/search/index.html?q=get-admin
Also bump the version, to be used for
#:version
in otherinfo.rkt
Original PR description is preserved here: