Skip to content
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

Some dfns are case-sensitive #625

Closed
annevk opened this issue Mar 7, 2016 · 6 comments
Closed

Some dfns are case-sensitive #625

annevk opened this issue Mar 7, 2016 · 6 comments

Comments

@annevk
Copy link
Collaborator

annevk commented Mar 7, 2016

We started introducing dfns in HTML for which casing matters. E.g., StructuredClone. @domenic noticed a problem with bikeshed lowercasing dfns here: whatwg/url@7b40216#commitcomment-16540044. Can that be changed somehow?

@domenic
Copy link
Collaborator

domenic commented Mar 7, 2016

What's weird is that it doesn't lowercase everything. Maybe just dfn-type definitions?

@tabatkins
Copy link
Collaborator

It's dfn-types and a few more: https://github.com/tabatkins/bikeshed/blob/master/bikeshed/config.py#L94

Can you elaborate more on what you're defining here? "dfn" types definitions are generally English, where casing can vary unpredictably. (In particular, a term appearing at the start of a sentence will be uppercased, and shouldn't require extra effort to link.) From the diff, it looks like HTML switched from an English-style name to a pseudocodish CappedAlgorithmName.

Maybe this means I should introduce an "algorithm" definition type, for this kind of "coding in English" function thing?

(Bonus: if I can tie this into the existing "algorithm" concept Bikeshed has, for scoping the use-checking of <var>, you'll get better behavior for free!)

(I don't want to change the behavior of dfn-type definitions here, even to something innocuous like "just lowercase during matching, preserve the original case when displaying", because you can start a sentence with a <dfn>, where the fact that it begins with an uppercase isn't an important part of the term, and seeing a capital in the index would be distracting.)

@domenic
Copy link
Collaborator

domenic commented Mar 7, 2016

A new dfn type sounds pretty reasonable to me. We'd add some data attribute to the dfn for Bikeshed to become aware of it? Alternately I guess a data attribute that says "preserve case", in case there are other non-algorithm use cases where this is important.

And yeah, it makes sense to lowercase things to allow people to use <dfn>s at the beginning of sentences.

@annevk
Copy link
Collaborator Author

annevk commented Mar 8, 2016

It gets a little weird if your dfn has abbreviations and such in it. You can also use lt if you put <dfn> as the first thing.

But I'm okay with trying to make algorithms work. But let's call it "abstract operation" then, shortened "ao" by the ECMAScript folks.

@tabatkins
Copy link
Collaborator

Ok, added an "abstract-op" type.

I'm planning on turning the "dfn" type into a supertype, encompassing a new "term" type (the old "dfn", for ordinary English terms) and "abstract-op". That way linking with a plain <a> (or the [=foo=] shorthand) will catch abstract ops too.

@tabatkins
Copy link
Collaborator

Never mind, changing the link type fucks things up pretty deeply, and it turns out that mixing types with different capitalization rules into a supertype is not a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants