Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c6af641
Update configs and markdown plugins to support informative docs
kfranqueiro Feb 12, 2026
8bd53a1
Architect informative top-level page and guideline-level page
kfranqueiro Feb 12, 2026
49d95b6
Reorganize reused CSS, remove unused CSS
kfranqueiro Feb 12, 2026
464a3fc
Architect requirement-level page, implement side nav
kfranqueiro Feb 12, 2026
823e766
Fix zero-key-terms case
kfranqueiro Sep 25, 2025
bfdd4a1
Key terms: Resolve both singular/plural forms of synonyms; tolerate f…
kfranqueiro Feb 12, 2026
fd05c74
Key terms: Support recursive terms
kfranqueiro Feb 12, 2026
5d128eb
Add proof-of-concept Page Contents box for informative pages
kfranqueiro Feb 12, 2026
10f5950
Remove eleventy how-to files
kfranqueiro Sep 8, 2025
a9aed54
Simplify informative guideline page rendering
kfranqueiro Feb 12, 2026
d031c43
Add other docs to top-level index
kfranqueiro Feb 13, 2026
1a8f3d7
Add skeleton informative pages for all guidelines and provisions
kfranqueiro Feb 13, 2026
3ed4e50
Tweak all guidelines index page
iadawn Mar 6, 2026
3527718
Remove debug code
iadawn Mar 6, 2026
d6f8d5c
Merge branch 'main' into informative
kfranqueiro Mar 11, 2026
ed8cd3e
RequirementsList-related cleanup
kfranqueiro Mar 11, 2026
d447f09
Update lodash imports after syncing with main
kfranqueiro Mar 11, 2026
a4848bc
RequirementsList: Style updates
kfranqueiro Mar 11, 2026
f208d9c
Update DraftBanner wording
kfranqueiro Mar 11, 2026
db5d91e
Expand build check to validate normative/informative sync
kfranqueiro Mar 11, 2026
b4325ae
Re-sync informative filenames
kfranqueiro Mar 11, 2026
0932275
Switch from fast-glob to tinyglobby to reduce dependencies
kfranqueiro Mar 11, 2026
aa99e6e
Safeguard middleware against non-HTML resources
kfranqueiro Mar 11, 2026
5aa68f5
Reinstate unrecognized directive check as separate pass
kfranqueiro Mar 11, 2026
bab5cfc
Address cspell errors
kfranqueiro Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 0 additions & 6 deletions .github/workflows/gh-pages-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ jobs:
curl https://www.w3.org/publications/spec-generator/?type=respec -F file=@guidelines.tar -o dist/client/guidelines/index.html -f --retry 3
curl https://www.w3.org/publications/spec-generator/?type=respec -F file=@explainer.tar -o dist/client/explainer/index.html -f --retry 3
curl https://www.w3.org/publications/spec-generator/?type=respec -F file=@requirements.tar -o dist/client/requirements/index.html -f --retry 3
- name: Build and copy how-tos
run: |
cd how-to
npm ci
npm run build:gh-pages
cp -r _site ../dist/client/how-to
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
54 changes: 38 additions & 16 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from "astro/config";
import node from "@astrojs/node";
import { parseFrontmatter } from "@astrojs/markdown-remark";
import { load } from "cheerio";
import fg from "fast-glob";
import { glob } from "tinyglobby";
import difference from "lodash/difference";
import { remarkDefinitionList, defListHastHandlers } from "remark-definition-list";
import remarkDirective from "remark-directive";
Expand All @@ -11,7 +11,7 @@ import { readFile, writeFile } from "fs/promises";
import { basename, dirname, join } from "path";
import { fileURLToPath } from "url";

import { guidelinesRehypePlugins, guidelinesRemarkPlugins } from "./src/lib/markdown/guidelines";
import { remarkPlugins, rehypePlugins } from "./src/lib/markdown";

const GH_REPO = process.env.GITHUB_REPOSITORY; // Only set during GitHub action

Expand All @@ -24,8 +24,8 @@ export default defineConfig({
devToolbar: { enabled: false },
trailingSlash: "always",
markdown: {
remarkPlugins: [remarkDirective, remarkDefinitionList, ...guidelinesRemarkPlugins],
rehypePlugins: [...guidelinesRehypePlugins],
remarkPlugins: [remarkDirective, remarkDefinitionList, ...remarkPlugins],
rehypePlugins: rehypePlugins,
remarkRehype: {
// https://github.com/wataru-chocola/remark-definition-list/issues/50#issuecomment-1445130314
handlers: { ...defListHastHandlers },
Expand All @@ -37,7 +37,7 @@ export default defineConfig({
},
integrations: [
{
/** Checks for mismatched children array vs. subdirectory contents */
/** Checks sync of children array vs. subdirectory contents and normative vs. informative */
name: "children-check",
hooks: {
"astro:build:start": async () => {
Expand All @@ -49,7 +49,7 @@ export default defineConfig({

const groupsPath = join("guidelines", "groups");
const groupIds = (
await fg.glob("*.json", {
await glob("*.json", {
cwd: groupsPath,
ignore: ["index.json"],
})
Expand All @@ -71,31 +71,53 @@ export default defineConfig({
for (const id of groupIds) {
const data = JSON.parse(await readFile(join(groupsPath, `${id}.json`), "utf8"));

const actualFiles = (await fg.glob("*.md", { cwd: join(groupsPath, id) })).map(
const normativeFiles = (await glob("*.md", { cwd: join(groupsPath, id) })).map(
(filename) => basename(filename, ".md")
);
if (data.children.length !== actualFiles.length) {
if (data.children.length !== normativeFiles.length) {
throw new Error(
`groups/${id}.json lists ${data.children.length} children but groups/${id}/ contains ${
actualFiles.length
} files (check: ${getUniqueEntries(actualFiles, data.children)})`
normativeFiles.length
} files (check: ${getUniqueEntries(normativeFiles, data.children)})`
);
}

const informativeFiles = (await glob("*.md", { cwd: join("informative", id) })).map(
(filename) => basename(filename, ".md")
);
if (normativeFiles.join() !== informativeFiles.join()) {
throw new Error(
`Mismatch between normative and informative directory contents for ${id} (check: ${
getUniqueEntries(normativeFiles, informativeFiles)
})`
);
}
}

// Check at guideline level (*/*.md -> */*/*.md)
for (const filename of await fg.glob(join(groupsPath, "*", "*.md"))) {
for (const filename of await glob(join(groupsPath, "*", "*.md"))) {
const id = join(basename(dirname(filename)), basename(filename, ".md"));
const data = parseFrontmatter(await readFile(filename, "utf8")).frontmatter;

const actualFiles = (await fg.glob("*.md", { cwd: join(groupsPath, id) })).map(
const normativeFiles = (await glob("*.md", { cwd: join(groupsPath, id) })).map(
(filename) => basename(filename, ".md")
);
if (data.children.length !== actualFiles.length) {
if (data.children.length !== normativeFiles.length) {
throw new Error(
`groups/${id}.md lists ${data.children.length} children but groups/${id}/ contains ${
actualFiles.length
} files (check: ${getUniqueEntries(actualFiles, data.children)})`
normativeFiles.length
} files (check: ${getUniqueEntries(normativeFiles, data.children)})`
);
}

const informativeFiles = (await glob("*.md", { cwd: join("informative", id) })).map(
(filename) => basename(filename, ".md")
);
if (normativeFiles.join() !== informativeFiles.join()) {
throw new Error(
`Mismatch between normative and informative directory contents for ${id} (check: ${
getUniqueEntries(normativeFiles, informativeFiles)
})`
);
}
}
Expand All @@ -109,7 +131,7 @@ export default defineConfig({
"astro:build:done": async ({ dir }) => {
if (!process.env.WCAG_DIFFABLE) return;
const distPath = fileURLToPath(dir);
const htmlPaths = await fg.glob("**/*.html", { cwd: distPath });
const htmlPaths = await glob("**/*.html", { cwd: distPath });
const start = Date.now();
for (const path of htmlPaths) {
const filePath = join(distPath, path);
Expand Down
6 changes: 5 additions & 1 deletion cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ languageSettings:
- foreign-language
- html-tags
# pre/code tags
- /<(pre|code)\b[^>]*>[\s\S]*?</\1>/g
- /<(pre|code)\b[^>]*>[\s\S]*?<\/\1>/g
# style tags
- /<style\b[^>]*>[\s\S]*?<\/style>/g
# template literal expressions
- /\$\{[\s\S]*?\}/g
- languageId: markdown
ignoreRegExpList:
- encoded-citations
Expand Down
1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NOAA
TOTP
UAAG
UCS
WAI
WCAG

# Proper names
Expand Down
83 changes: 0 additions & 83 deletions how-to/.eleventy.js

This file was deleted.

7 changes: 0 additions & 7 deletions how-to/_includes/card.html

This file was deleted.

22 changes: 0 additions & 22 deletions how-to/_includes/layout.html

This file was deleted.

Loading
Loading