From 1062e1358e9fa8a243124b3bb01ebbb0acd6e7bc Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 11 Jul 2024 22:12:12 +0200 Subject: [PATCH 01/16] Improved accessibility --- scripts/md2html/build.sh | 4 ++-- scripts/md2html/md2html.js | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/md2html/build.sh b/scripts/md2html/build.sh index 8a017667d8..dfee2f3d2a 100755 --- a/scripts/md2html/build.sh +++ b/scripts/md2html/build.sh @@ -42,12 +42,12 @@ for filename in ../../versions/[23456789].*.md ; do tempfile=../../deploy/oas/v$version-tmp.html echo -e "\n=== v$version ===" node md2html.js --respec --maintainers ./history/MAINTAINERS_v$version.md ${filename} > $tempfile - npx respec --use-local --src $tempfile --out ../../deploy/oas/v$version.html + npx respec --use-local --src $tempfile --out ../../deploy/oas/v$version-a11y.html rm $tempfile if [ $version = $latest ]; then if [[ ${version} != *"rc"* ]];then # version is not a Release Candidate - cp -p ../../deploy/oas/v$version.html ../../deploy/oas/latest.html + cp -p ../../deploy/oas/v$version-a11y.html ../../deploy/oas/latest-a11y.html latestCopied=v$version fi fi diff --git a/scripts/md2html/md2html.js b/scripts/md2html/md2html.js index 95bd23adc0..19138f412e 100644 --- a/scripts/md2html/md2html.js +++ b/scripts/md2html/md2html.js @@ -37,7 +37,7 @@ const md = require('markdown-it')({ highlight: function (str, lang) { if (lang && hljs.getLanguage(lang)) { // && !argv.respec) { try { - return '
' +
+              return '
' +
                   hljs.highlight(str, { language: lang }).value +
                   '
'; } catch (__) { } @@ -104,6 +104,7 @@ function preface(title,options) { catch (ex) {} preface += ''; preface += ''; preface += `

${title.split('|')[0]}

`; From 9a4a1ea4ecdb399ecb818474c3d6f7e13d4ae57c Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 11 Jul 2024 23:11:17 +0200 Subject: [PATCH 02/16] headings darker green --- scripts/md2html/md2html.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/md2html/md2html.js b/scripts/md2html/md2html.js index 19138f412e..31d20f04df 100644 --- a/scripts/md2html/md2html.js +++ b/scripts/md2html/md2html.js @@ -106,8 +106,9 @@ function preface(title,options) { preface += ''; preface += `

${title.split('|')[0]}

`; preface += ``; From 16bd0d0698108cd07125aec08fcd1f2fc3656fea Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Mon, 15 Jul 2024 15:39:52 +0200 Subject: [PATCH 04/16] headlines, syntax highlighting --- scripts/md2html/md2html.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/md2html/md2html.js b/scripts/md2html/md2html.js index d18bb9f5a6..46b7c2a905 100644 --- a/scripts/md2html/md2html.js +++ b/scripts/md2html/md2html.js @@ -107,7 +107,7 @@ function preface(title,options) { preface += '#respec-ui { visibility: hidden; }'; preface += '#title { color: #629b34; } #subtitle { color: #629b34; }'; preface += '.dt-published { color: #629b34; } .dt-published::before { content: "Published "; }'; - preface += 'h1,h2,h3,h4 { color: #45512c; }'; + preface += 'h1,h2,h3,h4,h5,h6 { color: #45512c; font-weight: normal; font-style: normal; }'; preface += 'a[href] { color: #45512c; }'; // third OAI colour is #8ad000 preface += 'body:not(.toc-inline) #toc h2 { color: #45512c; }'; preface += 'table { display: block; width: 100%; overflow: auto; }'; @@ -118,6 +118,7 @@ function preface(title,options) { preface += 'pre { background-color: #f6f8fa !important; }'; preface += 'code { color: #c83500 } th code { color: inherit }'; preface += 'cite { font-weight: bold; text-decoration: underline;}'; + preface += '.hljs-literal { color: #0076c0; } .hljs-name { color: #986801; } .hljs-attribute,.hljs-symbol,.hljs-string { color: #428030; }'; //TODO: end-of-extract // preface += fs.readFileSync(path.resolve(__dirname,'gist.css'),'utf8').split('\n').join(' '); preface += ''; From af69cb307ad54c121b1c0e25109fa99174836611 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Mon, 15 Jul 2024 16:46:10 +0200 Subject: [PATCH 05/16] Headlines, no blank line at beginning of code block --- scripts/md2html/md2html.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/md2html/md2html.js b/scripts/md2html/md2html.js index 46b7c2a905..6a4297849a 100644 --- a/scripts/md2html/md2html.js +++ b/scripts/md2html/md2html.js @@ -105,11 +105,12 @@ function preface(title,options) { preface += ''; preface += `

${title.split('|')[0]}

`; preface += ``; @@ -205,67 +201,30 @@ let indents = [0]; for (let l in lines) { let line = lines[l]; + // remove TOC from older spec versions, respec will generate a new one if (line.startsWith('## Table of Contents')) inTOC = true; if (line.startsWith('