w3c / wcag

Web Content Accessibility Guidelines
https://w3c.github.io/wcag/guidelines/22/
Other
1.14k stars 257 forks source link

Fix display of “New in WCAG 22” text #3912

Closed yatil closed 5 months ago

yatil commented 5 months ago

Changing the class from wcag22 to wcag2.2 should fix the mentions of non-existing WCAG version 22 throughout the WCAG Understanding Documents.

Example: https://www.w3.org/WAI/WCAG22/Understanding/focus-visible.html

The text says:

Note that a keyboard focus indicator can take different forms. New in WCAG 22: While Focus Visible does not specify what that form is, 2.4.13 Focus Appearance (Level AAA) provides guidance on creating a consistent, visible indicator.

This fix should change it to “New in WCAG 2.2”.

w3cbot commented 5 months ago

yatil marked as non substantive for IPR from ash-nazg.

patrickhlauke commented 5 months ago

how does changing the classname help? is there a script somewhere that naively grabs whatever the classname is and generates the text? /cc @iadawn

yatil commented 5 months ago

@patrickhlauke I think that is what this section of the XSLT does, but I’m no XSLT expert.

https://github.com/w3c/wcag/blob/ba81e62b839c64fb3789dff714934c514514eec0/xslt/base.xslt#L192-L212

yatil commented 5 months ago

Reading it again, it looks like the script inserts $guidelines.version which is probably defined elsewhere…

And that elsewhere is here:

https://github.com/w3c/wcag/blob/ba81e62b839c64fb3789dff714934c514514eec0/build.xml#L13

I have no idea if changing this to 2.2 breaks everything or not. But suffice to say, my PR probably doesn’t work and I’ll close it.

yatil commented 5 months ago

Looks from my limited local testing that changing the version in the build.xml also does not break things, so I’ve reopened the PR. I apologize for the back and forth, last time when I tried building it, it just exploded in my face. 😂

w3cbot commented 5 months ago

yatil marked as non substantive for IPR from ash-nazg.

patrickhlauke commented 5 months ago

i'd caution that the build pipeline may be using that $guidelines.version to determine the final URL, i.e. https://www.w3.org/TR/WCAG22/ ... but @iadawn will hopefully know best

worst/simplest case, can probably set up a new variable for "human readable" version number and use that

yatil commented 5 months ago

Yeah, I don’t expect this to be merged as is, the house of cards that is the WCAG build process is too fragile for that. In the same time, I’d like to not add additional variables that might then not be updated accidentally.

kfranqueiro commented 5 months ago

Changing the value of guidelines.version in build.xml is likely to have many ripple effects. Moreover, there is already another variable that does what you want:

https://github.com/w3c/wcag/blob/ba81e62b839c64fb3789dff714934c514514eec0/xslt/base.xslt#L11

Changing this line...

https://github.com/w3c/wcag/blob/ba81e62b839c64fb3789dff714934c514514eec0/xslt/base.xslt#L206

...to reference guidelines.version.decimal instead should do what you want, with no other changes necessary.

FWIW, this will also be fixed in the new Eleventy-based build process in #3917.

yatil commented 5 months ago

I wasn’t aware of an Eleventy build process being in development, @kfranqueiro. (I hope the Jekyll templates can be reused.) I don’t think it’s worth working on this for now.