diff --git a/.pr-preview.json b/.pr-preview.json index 49b06777..5ca47f73 100644 --- a/.pr-preview.json +++ b/.pr-preview.json @@ -1,4 +1,7 @@ { "src_file": "index.bs", - "type": "bikeshed" + "type": "bikeshed", + "post_processing": { + "name": "webidl-grammar" + } } diff --git a/Makefile b/Makefile index 93d04af9..5589e084 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ -bs := $(shell command -v bikeshed 2> /dev/null) +bs_installed := $(shell command -v bikeshed 2> /dev/null) +npm_installed := $(shell command -v npm 2> /dev/null) +pp_webidl_installed := $(shell npm ls webidl-grammar-post-processor --parseable --depth=0 2> /dev/null) all : index.html index.html : index.bs -ifdef bs +ifdef bs_installed bikeshed spec index.bs else - @echo Cannot find a local version of Bikeshed. To install it, visit: + @echo Can't find a local version of Bikeshed. To install it, visit: @echo @echo https://github.com/tabatkins/bikeshed/blob/master/docs/install.md @echo @@ -14,6 +16,18 @@ else @echo This will fail if you are not connected to the network. curl https://api.csswg.org/bikeshed/ -F file=@index.bs > index.html endif +ifdef pp_webidl_installed + npm run pp-webidl -- --input index.html +else ifdef npm_installed + npm install + npm run pp-webidl -- --input index.html +else + @echo You need node.js and npm to apply post-processing. To install it, visit: + @echo + @echo https://nodejs.org/en/download/ + @echo + @echo Until then, post-processing will be done dynamically, in JS, on page load. +endif clean : rm -f index.html diff --git a/deploy.sh b/deploy.sh index 7e767dbe..717f679a 100755 --- a/deploy.sh +++ b/deploy.sh @@ -7,6 +7,7 @@ TARGET_BRANCH="gh-pages" function doCompile { curl https://api.csswg.org/bikeshed/ -F file=@index.bs > out/index.html node ./check-grammar.js ./out/index.html + npm run pp-webidl -- --input ./out/index.html } # Pull requests and commits to other branches shouldn't try to deploy, just build to verify diff --git a/index.bs b/index.bs index 00911b01..73e8be55 100644 --- a/index.bs +++ b/index.bs @@ -13632,7 +13632,7 @@ The following conformance classes are defined by this specification: criteria in this specification that apply to implementations for the ECMAScript language binding. - - +