-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into patrickhlauke-issue3949
- Loading branch information
Showing
310 changed files
with
1,192 additions
and
3,594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: CI | ||
name: Push to gh-pages branch | ||
|
||
# Reference documentation: https://docs.github.com/en/actions/reference | ||
|
||
|
@@ -36,10 +36,13 @@ jobs: | |
curl https://labs.w3.org/spec-generator/?type=respec"&"url=https://raw.githack.com/$GITHUB_REPOSITORY/main/requirements/22/index.html -o _site/requirements/22/index.html -f --retry 3 | ||
curl https://labs.w3.org/spec-generator/?type=respec"&"url=https://raw.githack.com/$GITHUB_REPOSITORY/main/conformance-challenges/index.html -o _site/conformance-challenges/index.html -f --retry 3 | ||
- name: Push | ||
working-directory: _site | ||
run: | | ||
git config user.email [email protected] | ||
git config user.name w3cgruntbot | ||
git add -A . | ||
git commit -m ":robot: Deploy to GitHub Pages: $GITHUB_SHA from branch $GITHUB_REF" | ||
git push origin gh-pages | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
repository: _site | ||
branch: gh-pages | ||
commit_user_name: w3cgruntbot | ||
commit_user_email: [email protected] | ||
commit_author: "w3cgruntbot <[email protected]>" | ||
commit_message: ":robot: Deploy to GitHub Pages: ${{ github.sha }} from branch ${{ github.ref }}" | ||
skip_fetch: true | ||
skip_checkout: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import axios from "axios"; | ||
import { readFile } from "fs/promises"; | ||
import { glob } from "glob"; | ||
import uniq from "lodash-es/uniq"; | ||
|
||
import { wrapAxiosRequest } from "./common"; | ||
|
||
export const biblioPattern = /\[\[\??([\w-]+)\]\]/g; | ||
|
||
/** Compiles URLs from local biblio + specref for linking in Understanding documents. */ | ||
export async function getBiblio() { | ||
const localBiblio = eval( | ||
(await readFile("biblio.js", "utf8")) | ||
.replace(/^respecConfig\.localBiblio\s*=\s*/, "(") | ||
.replace("};", "})") | ||
); | ||
|
||
const refs: string[] = []; | ||
for (const path of await glob(["guidelines/**/*.html", "understanding/*/*.html"])) { | ||
const content = await readFile(path, "utf8"); | ||
let match; | ||
while ((match = biblioPattern.exec(content))) if (!localBiblio[match[1]]) refs.push(match[1]); | ||
} | ||
const uniqueRefs = uniq(refs); | ||
|
||
const response = await wrapAxiosRequest( | ||
axios.get(`https://api.specref.org/bibrefs?refs=${uniqueRefs.join(",")}`) | ||
); | ||
const fullBiblio = { | ||
...response.data, | ||
...localBiblio, | ||
}; | ||
|
||
const resolvedRefs = Object.keys(fullBiblio); | ||
const unresolvedRefs = uniqueRefs.filter((ref) => !resolvedRefs.includes(ref)); | ||
if (unresolvedRefs.length) console.warn(`Unresolved biblio refs: ${unresolvedRefs.join(", ")}`); | ||
|
||
return fullBiblio; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.