From 3ed0e0ae1c09564b5ff84a09cece1e37436f976e Mon Sep 17 00:00:00 2001 From: Michael Cooper Date: Wed, 5 Aug 2020 17:19:55 -0400 Subject: [PATCH] Add ability to generate materials for different versions of guidelines --- .gitignore | 6 ++++ build.xml | 55 +++++++++++++++++++------------- css/base.css | 17 ++++++++++ script/wcag.js | 6 ++-- xslt/base.xslt | 24 ++++++++++++++ xslt/generate-techniques.xslt | 1 + xslt/generate-understanding.xslt | 1 + 7 files changed, 85 insertions(+), 25 deletions(-) create mode 100644 css/base.css diff --git a/.gitignore b/.gitignore index 193897b182..c23c97841c 100644 --- a/.gitignore +++ b/.gitignore @@ -214,3 +214,9 @@ pip-log.txt #Mr Developer .mr.developer.cfg + +############# +## Apache Ant +############# + +build.properties diff --git a/build.xml b/build.xml index 92cec00538..6a77f60971 100644 --- a/build.xml +++ b/build.xml @@ -10,6 +10,8 @@ + + @@ -96,13 +98,14 @@ - - - + + + + - + @@ -175,16 +178,18 @@ + - - - + + + + @@ -211,9 +216,10 @@ - - - + + + + @@ -232,13 +238,15 @@ - - - + + + + + @@ -267,9 +275,10 @@ - - - + + + + @@ -278,11 +287,11 @@ - + - + - + @@ -319,18 +328,18 @@ - + - + - + - + diff --git a/css/base.css b/css/base.css new file mode 100644 index 0000000000..b028c7b059 --- /dev/null +++ b/css/base.css @@ -0,0 +1,17 @@ +.wcag21, .wcag22 { + background-color: #E9FBE9; + border-left: solid .5em #52E052; +} +span.wcag21, span.wcag22 { + margin-left: .25em; + padding-left: .25em; +} +div.wcag21, div.wcag22 { + margin: 1em auto; + padding: .5em; + page-break-inside: avoid; +} +.new-version { + font-size: smaller; + font-weight: bold; +} \ No newline at end of file diff --git a/script/wcag.js b/script/wcag.js index ba8262cde6..92c4fb7ee5 100644 --- a/script/wcag.js +++ b/script/wcag.js @@ -1,3 +1,5 @@ +var version="22"; + function titleToPathFrag (title) { return title.toLowerCase().replace(/[\s,]+/g, "-").replace(/[\(\)]/g, ""); } @@ -5,13 +7,13 @@ function titleToPathFrag (title) { function linkUnderstanding() { var understandingBaseURI; if (respecConfig.specStatus == "ED") understandingBaseURI = "../../understanding/"; - else understandingBaseURI = "https://www.w3.org/WAI/WCAG21/Understanding/"; + else understandingBaseURI = "https://www.w3.org/WAI/WCAG" + version + "/Understanding/"; document.querySelectorAll('.sc').forEach(function(node){ var heading = node.firstElementChild.textContent; var pathFrag = titleToPathFrag(heading); var el = document.createElement("div"); el.setAttribute("class", "doclinks"); - el.innerHTML = "Understanding " + heading + " |
How to Meet " + heading + ""; + el.innerHTML = "Understanding " + heading + " |
How to Meet " + heading + ""; node.insertBefore(el, node.children[1]); }) } diff --git a/xslt/base.xslt b/xslt/base.xslt index cb5d5fa534..4c48b02acd 100644 --- a/xslt/base.xslt +++ b/xslt/base.xslt @@ -7,6 +7,8 @@ exclude-result-prefixes="#all" version="2.0"> + + /guidelines/ /understanding/ /techniques/ @@ -164,4 +166,26 @@ + + + Guidelines version not provided + + + + + + + + + + + + New in WCAG : + + + + + + + \ No newline at end of file diff --git a/xslt/generate-techniques.xslt b/xslt/generate-techniques.xslt index 739efbab13..4693a2257c 100644 --- a/xslt/generate-techniques.xslt +++ b/xslt/generate-techniques.xslt @@ -161,6 +161,7 @@ + diff --git a/xslt/generate-understanding.xslt b/xslt/generate-understanding.xslt index a9024faa5e..b5869802c4 100644 --- a/xslt/generate-understanding.xslt +++ b/xslt/generate-understanding.xslt @@ -237,6 +237,7 @@ <xsl:apply-templates select="//html:h1"/> +