- From: Steve Glaser <sglaser@nvidia.com>
- Date: Tue, 16 Sep 2014 11:23:13 -0700
- To: Tab Atkins Jr. <jackalmage@gmail.com>, Robin Berjon <robin@w3.org>
- CC: "spec-prod@w3.org" <spec-prod@w3.org>
-----Original Message----- From: Tab Atkins Jr. [mailto:jackalmage@gmail.com] Sent: Tuesday, September 16, 2014 11:02 AM To: Robin Berjon Cc: Steve Glaser; spec-prod@w3.org Subject: Re: Various respec enhancements ... On Tue, Sep 16, 2014 at 3:55 AM, Robin Berjon <robin@w3.org> wrote: > On 25/08/2014 02:56 , Steve Glaser wrote: >> 2.Lots of <dfn> classes. I wanted to be able to have a bunch of <dfn> >> types that were formatted differently by CSS. If you include <dfn >> class=”field”>foo</dfn>, then any <a>foo</a> fields will >> automatically get the right class (assuming no ambiguity – if it’s >> ambiguous, you get a message and have to put the class attribute on the <a> tag). > > That's cool, and I think it makes sense. One notion that I've thought > of previously is to have dfn-namespacing as well as alternatives. > > Namespacing would work basically like this. Say you have a markup > attribute and a DOM attribute both called 'unicorn'. You could have > <dfn>dom:unicorn</dfn> and <dfn>attr:unicorn</dfn>, and > <a>dom:unicorn</a> would link to the right one (and drop the namespace > on render of course). If you need a : in your dfn, \-escaping works. > > Alternatives would solve the common problem of referring to the same > dfn with variants (typically, plurals) for which today one has to > annoyingly resort to @title. For that, just use > <dfn>unicorn|unicorns|long-toothed > horse</dfn>. We've already solved this problem in Bikeshed/Shepherd, and it would be a crying shame to have ReSpec try to solve it in an incompatible way, as it would mean the two types of specs couldn't talk to each other. Bikeshed's relevant documention is here: <https://github.com/tabatkins/bikeshed/blob/master/docs/definitions-autolinks.md>. We've got a taxonomy of dfn types, which can also be applied to autolinks to disambiguate. There are multiple ways to specify what type a dfn is - an explicit data-dfn-type attribute, an id matching a particular pattern, a class (on the element or an ancestor) matching a particular pattern, or the text of the dfn itself matching certain patterns. Bikeshed makes this all pretty trivial and turns it explicit in the source for you, but ReSpec specs obviously would need to be a little more explicit about things, so that the correct information shows up in the source html. I'd *really* like ReSpec and Bikeshed to agree on this stuff, so that I can autolink into ReSpec specs. [Steve Glaser] I did it with different classes as that tied in to my desire to use different css formatting. I'm not wedded to that approach though and I agree the singular / plural issue is a pain. Any solution should play nicely with the automatic subscripts stuff (next item). >> 3.Automatic subscripts in <dfn>. I remember the innerHTML for each >> <dfn> and copy it to the <a>. That way if you have >> <dfn>T<sub>active</sub></dfn> and you reference it as <a>Tactive</a>, >> you get the <sub> stuff in the expansion.. > > Indeed, hadn't thought of that. Good feature. Agreed. Does this feature *only* cover subscripts/superscripts, or is there more formatting copied over? [Steve Glaser] I copy the entire innerHTML over. You can use anything you want. ~TJ ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
Received on Tuesday, 16 September 2014 18:23:43 UTC