From 80a65bae43868aa5a577da7b076cd3bca6e9e3aa Mon Sep 17 00:00:00 2001 From: Duncan Beevers Date: Fri, 7 Feb 2025 17:34:15 -0800 Subject: [PATCH 1/2] Combine build.sh and build-src.sh build.sh with no arguments operates the same; builds all versions to /deploy build.sh with version argument builds single version to /deploy-preview build.sh with "latest" argument builds latest version to /deploy-preview build.sh with "oas" argument builds from src/oas.md to /deploy-preview --- scripts/md2html/build.sh | 87 +++++++++++++++++++-------- scripts/md2html/md2html.js | 5 +- tests/md2html/fixtures/basic-new.html | 10 ++- tests/md2html/fixtures/basic-old.html | 10 ++- 4 files changed, 80 insertions(+), 32 deletions(-) diff --git a/scripts/md2html/build.sh b/scripts/md2html/build.sh index f716e815bc..43b4260bb6 100755 --- a/scripts/md2html/build.sh +++ b/scripts/md2html/build.sh @@ -2,22 +2,38 @@ # Author: @MikeRalphson -# run this script from the root of the repo. It is designed to be run by a GitHub workflow. +# run this script from the root of the repo +# It is designed to be run by a GitHub workflow + +# Usage: build.sh [version | "latest" | "src"] +# When run with no arguments, it builds artifacts for all published specification versions. +# It may also be run with a specific version argument, such as "3.1.1" or "latest" +# Finally, it may be run with "src" to build "src/oas.md" +# # It contains bashisms -mkdir -p deploy/oas -mkdir -p deploy/js +if [ -z "$1" ]; then + deploydir="deploy/oas" +else + deploydir="deploy-preview" +fi + +mkdir -p $deploydir/js +mkdir -p $deploydir/temp + +latest=$(git describe --abbrev=0 --tags) +latestCopied="none" +lastMinor="-" -cd scripts/md2html mkdir -p history -cat > history/MAINTAINERS_v2.0.md < history/MAINTAINERS_v2.0.md << EOF ## Active * Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) * Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) * Ron Ratovsky [@webron](https://github.com/webron) * Tony Tam [@fehguy](https://github.com/fehguy) EOF -cat > history/MAINTAINERS_v3.0.0.md < history/MAINTAINERS_v3.0.0.md << EOF ## Active * Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) * Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) @@ -36,38 +52,57 @@ git show c3b88ed:EDITORS.md > history/MAINTAINERS_v3.0.4.md cp history/MAINTAINERS_v3.0.4.md history/MAINTAINERS_v3.1.1.md # add lines for 3.2.0, ... -cp -p ../../node_modules/respec/builds/respec-w3c.* ../../deploy/js/ +if [ -z "$1" ]; then + specifications=$(ls -1 versions/[23456789].*.md | sort -r) +elif [ "$1" = "latest" ]; then + specifications=$(ls -1 versions/$latest.md) +elif [ "$1" = "src" ]; then + specifications="src/oas.md" +else + specifications=$(ls -1 versions/$1.md) +fi -latest=`git describe --abbrev=0 --tags` -latestCopied=none -lastMinor="-" -for filename in $(ls -1 ../../versions/[23456789].*.md | sort -r) ; do - version=$(basename "$filename" .md) +cp -p node_modules/respec/builds/respec-w3c.* $deploydir/js/ + +for specification in $specifications; do + version=$(basename $specification .md) minorVersion=${version:0:3} - tempfile=../../deploy/oas/v$version-tmp.html - echo -e "\n=== v$version ===" + destination="$deploydir/$version.html" + tempfile="$deploydir/temp/$version.html" - node md2html.js --maintainers ./history/MAINTAINERS_v$version.md ${filename} > $tempfile - npx respec --use-local --src $tempfile --out ../../deploy/oas/v$version.html + if [ "$1" = "src" ]; then + maintainers="EDITORS.md" + else + maintainers="history/MAINTAINERS_v$version.md" + fi + + echo === Building $version to $destination + + node scripts/md2html/md2html.js --maintainers $maintainers $specification > $tempfile + npx respec --use-local --src $tempfile --out $destination rm $tempfile + echo === Built $destination + if [ $version = $latest ]; then - if [[ ${version} != *"rc"* ]];then + if [[ ${version} != *"rc"* ]]; then # version is not a Release Candidate - pushd ../../deploy/oas - ln -sf v$version.html latest.html - popd - latestCopied=v$version + ln -sf $(basename $destination) $deploydir/latest.html + latestCopied="v$version" fi fi if [ ${minorVersion} != ${lastMinor} ] && [ ${minorVersion} != 2.0 ]; then - pushd ../../deploy/oas - ln -sf v$version.html v$minorVersion.html - popd + ln -sf $(basename $destination) $deploydir/v$minorVersion.html lastMinor=$minorVersion fi done -echo Latest tag is $latest, copied $latestCopied to latest.html -rm ../../deploy/js/respec-w3c.* +if [ "$latestCopied" != "none" ]; then + echo Latest tag is $latest, copied $latestCopied to latest.html +fi + +rm $deploydir/js/respec-w3c.* +rmdir $deploydir/js +rmdir $deploydir/temp +rm -r history diff --git a/scripts/md2html/md2html.js b/scripts/md2html/md2html.js index fd3ec78f69..2ddb4e335b 100644 --- a/scripts/md2html/md2html.js +++ b/scripts/md2html/md2html.js @@ -131,10 +131,7 @@ function preface(title,options) { // ReSpec preface += ''; preface += ``; - try { - preface += fs.readFileSync('./analytics/google.html','utf8'); - } - catch (ex) {} + preface += fs.readFileSync(path.resolve(__dirname, 'analytics/google.html'),'utf8'); preface += ''; preface += '

OpenAPI Specification v30.0.1

What is the OpenAPI Specification?

The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.

Status of This Document

The source-of-truth for this specification is the HTML file referenced above as This version.
+OpenAPI Specification v30.0.1 | Introduction, Definitions, & More + + +

OpenAPI Specification v30.0.1

What is the OpenAPI Specification?

The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.

Status of This Document

The source-of-truth for this specification is the HTML file referenced above as This version.

Heading 1

Text for first chapter

Version 30.0.1

diff --git a/tests/md2html/fixtures/basic-old.html b/tests/md2html/fixtures/basic-old.html index a80b4489fb..0f4463eedd 100644 --- a/tests/md2html/fixtures/basic-old.html +++ b/tests/md2html/fixtures/basic-old.html @@ -1,4 +1,12 @@ -OpenAPI Specification v30.0.1 | Introduction, Definitions, & More

OpenAPI Specification v30.0.1

What is the OpenAPI Specification?

The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.

Status of This Document

The source-of-truth for this specification is the HTML file referenced above as This version.
+OpenAPI Specification v30.0.1 | Introduction, Definitions, & More + + +

OpenAPI Specification v30.0.1

What is the OpenAPI Specification?

The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.

Status of This Document

The source-of-truth for this specification is the HTML file referenced above as This version.

Heading 1

Text for first chapter

Version 30.0.1

From 9c02f334c9b82dd9b650b62a071228529777b0a3 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 19 Dec 2024 18:04:22 +0100 Subject: [PATCH 2/2] Materialize lists of editors per spec version --- scripts/md2html/build.sh | 35 ++++------------------------------- versions/2.0-editors.md | 5 +++++ versions/3.0.0-editors.md | 8 ++++++++ versions/3.0.1-editors.md | 9 +++++++++ versions/3.0.2-editors.md | 11 +++++++++++ versions/3.0.3-editors.md | 11 +++++++++++ versions/3.0.4-editors.md | 18 ++++++++++++++++++ versions/3.1.0-editors.md | 11 +++++++++++ versions/3.1.1-editors.md | 18 ++++++++++++++++++ 9 files changed, 95 insertions(+), 31 deletions(-) create mode 100644 versions/2.0-editors.md create mode 100644 versions/3.0.0-editors.md create mode 100644 versions/3.0.1-editors.md create mode 100644 versions/3.0.2-editors.md create mode 100644 versions/3.0.3-editors.md create mode 100644 versions/3.0.4-editors.md create mode 100644 versions/3.1.0-editors.md create mode 100644 versions/3.1.1-editors.md diff --git a/scripts/md2html/build.sh b/scripts/md2html/build.sh index 43b4260bb6..dcfe5b1365 100755 --- a/scripts/md2html/build.sh +++ b/scripts/md2html/build.sh @@ -25,35 +25,8 @@ latest=$(git describe --abbrev=0 --tags) latestCopied="none" lastMinor="-" -mkdir -p history -cat > history/MAINTAINERS_v2.0.md << EOF -## Active -* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) -* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) -* Ron Ratovsky [@webron](https://github.com/webron) -* Tony Tam [@fehguy](https://github.com/fehguy) -EOF -cat > history/MAINTAINERS_v3.0.0.md << EOF -## Active -* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) -* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) -* Ron Ratovsky [@webron](https://github.com/webron) -* Tony Tam [@fehguy](https://github.com/fehguy) - -## Emeritus -* Jason Harmon [@jharmn](https://github.com/jharmn) -EOF -git show c740e95:MAINTAINERS.md > history/MAINTAINERS_v3.0.1.md -git show 3140640:MAINTAINERS.md > history/MAINTAINERS_v3.0.2.md -cp history/MAINTAINERS_v3.0.2.md history/MAINTAINERS_v3.0.3.md -cp history/MAINTAINERS_v3.0.2.md history/MAINTAINERS_v3.1.0.md -#TODO: adjust commit for 3.0.4, 3.1.1 -git show c3b88ed:EDITORS.md > history/MAINTAINERS_v3.0.4.md -cp history/MAINTAINERS_v3.0.4.md history/MAINTAINERS_v3.1.1.md -# add lines for 3.2.0, ... - if [ -z "$1" ]; then - specifications=$(ls -1 versions/[23456789].*.md | sort -r) + specifications=$(ls -1 versions/[23456789].*.md | grep -v -e "\-editors" | sort -r) elif [ "$1" = "latest" ]; then specifications=$(ls -1 versions/$latest.md) elif [ "$1" = "src" ]; then @@ -67,13 +40,14 @@ cp -p node_modules/respec/builds/respec-w3c.* $deploydir/js/ for specification in $specifications; do version=$(basename $specification .md) minorVersion=${version:0:3} - destination="$deploydir/$version.html" tempfile="$deploydir/temp/$version.html" if [ "$1" = "src" ]; then + destination="$deploydir/$version.html" maintainers="EDITORS.md" else - maintainers="history/MAINTAINERS_v$version.md" + destination="$deploydir/v$version.html" + maintainers="$(dirname $specification)/$version-editors.md" fi echo === Building $version to $destination @@ -105,4 +79,3 @@ fi rm $deploydir/js/respec-w3c.* rmdir $deploydir/js rmdir $deploydir/temp -rm -r history diff --git a/versions/2.0-editors.md b/versions/2.0-editors.md new file mode 100644 index 0000000000..de30bb5d63 --- /dev/null +++ b/versions/2.0-editors.md @@ -0,0 +1,5 @@ +## Active +* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) +* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) +* Ron Ratovsky [@webron](https://github.com/webron) +* Tony Tam [@fehguy](https://github.com/fehguy) diff --git a/versions/3.0.0-editors.md b/versions/3.0.0-editors.md new file mode 100644 index 0000000000..7278a62ab5 --- /dev/null +++ b/versions/3.0.0-editors.md @@ -0,0 +1,8 @@ +## Active +* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) +* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) +* Ron Ratovsky [@webron](https://github.com/webron) +* Tony Tam [@fehguy](https://github.com/fehguy) + +## Emeritus +* Jason Harmon [@jharmn](https://github.com/jharmn) diff --git a/versions/3.0.1-editors.md b/versions/3.0.1-editors.md new file mode 100644 index 0000000000..05849e61f5 --- /dev/null +++ b/versions/3.0.1-editors.md @@ -0,0 +1,9 @@ +## Active +* Darrel Miller [@darrelmiller](https://github.com/darrelmiller) +* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) +* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) +* Ron Ratovsky [@webron](https://github.com/webron) + +## Emeritus +* Jason Harmon [@jharmn](https://github.com/jharmn) +* Tony Tam [@fehguy](https://github.com/fehguy) diff --git a/versions/3.0.2-editors.md b/versions/3.0.2-editors.md new file mode 100644 index 0000000000..34421f2c62 --- /dev/null +++ b/versions/3.0.2-editors.md @@ -0,0 +1,11 @@ +## Active +* Darrel Miller [@darrelmiller](https://github.com/darrelmiller) +* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) +* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) +* Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson) +* Ron Ratovsky [@webron](https://github.com/webron) +* Uri Sarid [@usarid](https://github.com/usarid) + +## Emeritus +* Jason Harmon [@jharmn](https://github.com/jharmn) +* Tony Tam [@fehguy](https://github.com/fehguy) diff --git a/versions/3.0.3-editors.md b/versions/3.0.3-editors.md new file mode 100644 index 0000000000..34421f2c62 --- /dev/null +++ b/versions/3.0.3-editors.md @@ -0,0 +1,11 @@ +## Active +* Darrel Miller [@darrelmiller](https://github.com/darrelmiller) +* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) +* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) +* Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson) +* Ron Ratovsky [@webron](https://github.com/webron) +* Uri Sarid [@usarid](https://github.com/usarid) + +## Emeritus +* Jason Harmon [@jharmn](https://github.com/jharmn) +* Tony Tam [@fehguy](https://github.com/fehguy) diff --git a/versions/3.0.4-editors.md b/versions/3.0.4-editors.md new file mode 100644 index 0000000000..678e911b2b --- /dev/null +++ b/versions/3.0.4-editors.md @@ -0,0 +1,18 @@ +# OpenAPI Specification Editors + +## Active +* Darrel Miller [@darrelmiller](https://github.com/darrelmiller) +* Henry Andrews [@handrews](https://github.com/handrews) +* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) +* Lorna Mitchell [@lornajane](https://github.com/lornajane) +* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) +* Miguel Quintero [@miqui](https://github.com/miqui) +* Mike Kistler [@mikekistler](https://github.com/mikekistler) +* Ralf Handl [@ralfhandl](https://github.com/ralfhandl) +* Ron Ratovsky [@webron](https://github.com/webron) + +## Emeritus +* Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson) +* Uri Sarid [@usarid](https://github.com/usarid) +* Jason Harmon [@jharmn](https://github.com/jharmn) +* Tony Tam [@fehguy](https://github.com/fehguy) diff --git a/versions/3.1.0-editors.md b/versions/3.1.0-editors.md new file mode 100644 index 0000000000..34421f2c62 --- /dev/null +++ b/versions/3.1.0-editors.md @@ -0,0 +1,11 @@ +## Active +* Darrel Miller [@darrelmiller](https://github.com/darrelmiller) +* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) +* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) +* Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson) +* Ron Ratovsky [@webron](https://github.com/webron) +* Uri Sarid [@usarid](https://github.com/usarid) + +## Emeritus +* Jason Harmon [@jharmn](https://github.com/jharmn) +* Tony Tam [@fehguy](https://github.com/fehguy) diff --git a/versions/3.1.1-editors.md b/versions/3.1.1-editors.md new file mode 100644 index 0000000000..678e911b2b --- /dev/null +++ b/versions/3.1.1-editors.md @@ -0,0 +1,18 @@ +# OpenAPI Specification Editors + +## Active +* Darrel Miller [@darrelmiller](https://github.com/darrelmiller) +* Henry Andrews [@handrews](https://github.com/handrews) +* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) +* Lorna Mitchell [@lornajane](https://github.com/lornajane) +* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) +* Miguel Quintero [@miqui](https://github.com/miqui) +* Mike Kistler [@mikekistler](https://github.com/mikekistler) +* Ralf Handl [@ralfhandl](https://github.com/ralfhandl) +* Ron Ratovsky [@webron](https://github.com/webron) + +## Emeritus +* Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson) +* Uri Sarid [@usarid](https://github.com/usarid) +* Jason Harmon [@jharmn](https://github.com/jharmn) +* Tony Tam [@fehguy](https://github.com/fehguy)