diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7b8200a44..a206f945ba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -163,6 +163,19 @@ This might apply to, for example, Markdown files, automation, and scripts. For all pull requests, if they should not be merged yet for any reason (they depend on something else, you would like feedback from a specific reviewer), mark them as draft and they will not be merged while in that state. Draft pull requests can still be reviewed while in draft state. +### Preview specification HTML locally + +The markdown source files are converted to HTML before publishing. +To do this locally, please + +1. Install [Node.js](https://nodejs.org/) +2. Check out this repo, go to the repo root, and switch to a development branch +3. Execute `npm install` (once, repeat after merging upstream changes) +4. Execute `npm run build-src` after changing `src/oas.md` (this first executes `npm run validate-markdown`, which can also be run separately) +5. Open output file `deploy-preview/oas.html` with a browser and check your changes + +Please make sure the markdown validates and builds using the above steps before creating a pull request or marking a draft pull request as ready for review. + ## Reviewers > [!NOTE] diff --git a/scripts/md2html/build.sh b/scripts/md2html/build.sh index b40a1a12e2..68bedf9bc6 100755 --- a/scripts/md2html/build.sh +++ b/scripts/md2html/build.sh @@ -52,12 +52,16 @@ for specification in $specifications; do minorVersion=${version:0:3} tempfile="$deploydir/temp/$version.html" + tempfile2="$deploydir/temp/$version-2.html" echo === Building $version to $destination node scripts/md2html/md2html.js --maintainers $maintainers $specification "$allVersions" > $tempfile - npx respec --no-sandbox --use-local --src $tempfile --out $destination - rm $tempfile + npx respec --no-sandbox --use-local --src $tempfile --out $tempfile2 + # remove unwanted Google Tag Manager and Google Analytics scripts + sed -e 's/'; - preface += ``; - preface += fs.readFileSync(path.resolve(__dirname,'./analytics/google.html'),'utf8'); - preface += '
'; + preface += `\n`; + preface += '\n'; preface += 'Copyright © 3001 the Linux Foundation
Copyright © 3001 the Linux Foundation
Text for first chapter
Copyright © 3001 the Linux Foundation
Copyright © 3001 the Linux Foundation
Text for first chapter