-
Notifications
You must be signed in to change notification settings - Fork 266
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
Conversation
✅ Deploy Preview for wcag2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
kfranqueiro marked as non substantive for IPR from ash-nazg. |
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 :) |
@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 |
Added.
Fortunately, this code already lists the references that do not resolve:
|
3d26e54
to
7882fb0
Compare
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)
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.
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)