-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fix regex in api_xrefs #728
base: main
Are you sure you want to change the base?
Conversation
Make sense |
My weak preference would be to change line 72 to this:
I.e. removing the I assume you're using the I'll be out for a few weeks, so others in the groups should decide what to do. I'm not super opposed to this PR. However, if we are going to expand the set of legal characters for an "api name", it seems like we should allow anything, not just add |
Sure. The short version is that in SYCL SC, we're looking at creating some "tags" -- essentially glorified comments that can be placed anywhere in the spec. So the spec can say, " The longer version for people not familiar with this corner of spec tooling (based on my best understanding today): The new spec format uses asciidoc api_xrefs is a post-processing script that gets applied to the HTML output (so it's not available in the PDF). api_xrefs creates additional clickable links based on a key-value map. So while api_xrefs is primarily intended for C++ identifiers, I don't see any reason for limiting it to C++ identifiers. As I've discovered, |
I see. There are similar cases in the SYCL spec, but my plan was to handle this case differently. In SYCL, there are places where we want an expression to be in fixed-width font, and the expression might have terms that correspond to different APIs. For example, something like My plan was to add tooling that recognized Asciiidoc syntax like Expressions like this are not that common in the SYCL spec, so I haven't gotten around to writing this tooling, and it will probably remain low priority for a while. However, that is the direction I was thinking. If your project needs something like this sooner, you could consider writing this tooling, and contributing it to the "api_xrefs" extension. With this background, you can see why I'm hesitant to extend the regex the way this PR proposes. Once we add tooling for That said, I'm not totally opposed to the change in this PR as a temporary thing. However, you should expect that we will undo the change later when we implement |
Hmm, yes, I see. That does seem like a more important use case than being able to use I wasn't going to bring this up at first, but since we're talking about future directions, I'll just mention it: I have minor reservations about post-processing the HTML spec in general, because it raises the question of whether the PDF and HTML specs have parity and are equal sources of truth. I've thought of the |
Based on line 72, I think the intent was always that
-
would be a valid character for api-xrefs IDs (even though it's not a valid character for C++ identifiers). Prior to this fix, API IDs with-
characters (e.g.,[api]#my-api#
in asciidoc) were silently not getting thehref
treatment, because they were missed by the regex on line 117. I.e.,[api]#my_api#
would get a link in the HTML,[api]#my-api#
would not, and no error was generated.This took a while to debug.
Caveat: I know nothing about Ruby.