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

Add build support for linking to bibliographical references #4124

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

kfranqueiro
Copy link
Contributor

Refs #2535

This adds support to the Eleventy build system for resolving bibliographical references within paragraphs in the format [[ref]], and converting them into links within single brackets instead.

This resolves against both specref.org and the local bibliography configured in biblio.js in this repo.

Note that there are some references that have no resolution in either of these sources, which is why I'm not marking this as fully resolving the related issue.

Details at #2535 (comment)

Here's a breakdown of what is successfully replaced: (search for these in single brackets on the page in question on the PR preview; some may require expanding Key Terms)

  • 1.4.3 Contrast (Minimum): SRGB
  • 1.4.6 Contrast (Enhanced): SRGB
  • 1.4.11 Non-text Contrast: SRGB
  • 1.4.13 Content on Hover or Focus: HTML
  • 2.2.2 Pause, Stop, Hide: ISO_9241-391, SRGB
  • 2.3.1 Three Flashes or Below Threshold: ISO_9241-391, SRGB
  • 2.3.2 Three Flashes: ISO_9241-391
  • 2.4.13 Focus Appearance: SRGB
  • 2.5.5 Target Size (Enhanced): pointerevents
  • 2.5.8 Target Size (Minimum): pointerevents
  • 3.1.5 Reading Level: UNESCO (3 instances)
  • 3.2.1 On Focus: UAAG10
  • 3.2.2 On Input: UAAG10
  • 3.2.5 Change on Request: UAAG10
  • 4.1.3 Status Messages: UAAG10

@kfranqueiro kfranqueiro requested a review from iadawn October 29, 2024 20:47
Copy link

netlify bot commented Oct 29, 2024

Deploy Preview for wcag2 ready!

Name Link
🔨 Latest commit 7882fb0
🔍 Latest deploy log https://app.netlify.com/sites/wcag2/deploys/673cced500e9e80008600a21
😎 Deploy Preview https://deploy-preview-4124--wcag2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@w3cbot
Copy link

w3cbot commented Oct 29, 2024

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

@patrickhlauke
Copy link
Member

patrickhlauke commented Oct 29, 2024

There seem to also be some double-bracketed references here and there (e.g. https://deploy-preview-4124--wcag2.netlify.app/understanding/contrast-minimum#rationale-for-the-ratios-chosen)

EDIT: ah, never mind, i should read your actual description first before barging in ... still work in progress :)

11ty/biblio.ts Outdated Show resolved Hide resolved
@iadawn
Copy link
Contributor

iadawn commented Nov 18, 2024

@kfranqueiro Code looks fine to me. There is one comment relating to informative references which I think would be worth putting in.

Next step would be listing those references that do not resolve to anything. Will need to take those to the TF to come up with the correct references then we can add them into the biblio.js

@kfranqueiro
Copy link
Contributor Author

kfranqueiro commented Nov 19, 2024

@kfranqueiro Code looks fine to me. There is one comment relating to informative references which I think would be worth putting in.

Added.

Next step would be listing those references that do not resolve to anything. Will need to take those to the TF to come up with the correct references then we can add them into the biblio.js

Fortunately, this code already lists the references that do not resolve:

Unresolved biblio refs: LAALS, HEARING-AID-INT, ISO-9241-3, ANSI-HFES-100-1988, ARDITI-FAYE, ARDITI-KNOBLAUCH-1994, ARDITI-KNOBLAUCH-1996, ARDITI, GITTINGS-FOZARD

@kfranqueiro kfranqueiro merged commit 1744c59 into main Nov 20, 2024
5 checks passed
@kfranqueiro kfranqueiro deleted the kgf-biblio branch November 20, 2024 18:03
iadawn pushed a commit that referenced this pull request Nov 28, 2024
This is a follow-up to #4007, in which I had neglected to pin
definitions for key terms to the published recommendation when building
for 2.1.

- Moves `termsMap` definition to the Eleventy config (where all other
target-version-dependent assignments are made), to be passed into the
`CustomLiquid` constructor
- Updates `termsMap` references within `CustomLiquid` to use an instance
variable set in the constructor
- Updates `loadRemoteGuidelines` to account for pre-processed terms
content
  - Also updates to account for #4124
- Skips entirety of custom `render` processing for pages not being
output for 2.1 (to avoid irrelevant error messages as well as save time)
kfranqueiro added a commit that referenced this pull request Dec 6, 2024
Since #4124 was merged, all builds require an HTTP request to
api.specref.org in order to resolve additional bibliographical
references. This may cause issues in local dev in the case of being
offline due to travel or internet hiccups, behind a proxy, etc.

This commit adds a reusable function for cases where a HTTP failure
during local dev is tolerable, and uses it for the bibrefs request.

Running `npm build` will still result in an immediate failure and stack
trace; this is intentional to ensure that nothing slips by during builds
for PR previews, GitHub Pages, or w3.org.
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

Successfully merging this pull request may close these issues.

4 participants