From bc90cfbe119406d52477ff242b9b1bb94cf0f88d Mon Sep 17 00:00:00 2001 From: Tsche Date: Sun, 7 Apr 2024 06:52:59 +0200 Subject: [PATCH] build old standards --- .github/workflows/pages.yml | 16 +++++-- draft | 2 +- gen_annex_f.sh | 11 +++++ gen_html_std.sh | 94 ------------------------------------- gen_standard.sh | 58 +++++++++++++++++++++++ index.html | 16 +++++++ 6 files changed, 99 insertions(+), 98 deletions(-) create mode 100644 gen_annex_f.sh delete mode 100755 gen_html_std.sh create mode 100755 gen_standard.sh create mode 100644 index.html diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index c6332e17ea..3f9583ac67 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -52,12 +52,22 @@ jobs: cd cxxdraft-htmlgen npm install split npm install mathjax-node-cli + cd .. + export PATH=$PATH:$PWD/cxxdraft-htmlgen/node_modules/.bin + + - name: Copy index + run: | + cp index.html build/index.html - name: Build site run: | - ls $PWD/cxxdraft-htmlgen/node_modules/.bin - export PATH=$PATH:$PWD/cxxdraft-htmlgen/node_modules/.bin - ./gen_html_std.sh + ./gen_standard.sh + ./gen_standard.sh n4950 c++23 + ./gen_standard.sh n4868 c++20 + ./gen_standard.sh n4659 c++17 + ./gen_standard.sh n4140 c++14 + ./gen_standard.sh n3337 c++11 + - name: List output files run: tree build diff --git a/draft b/draft index 9526420c63..9f7f3659c0 160000 --- a/draft +++ b/draft @@ -1 +1 @@ -Subproject commit 9526420c631073fb7166f9f5a645a3a6b1a219a1 +Subproject commit 9f7f3659c0b74c9519d751dfd5838d7a88a0e166 diff --git a/gen_annex_f.sh b/gen_annex_f.sh new file mode 100644 index 0000000000..a8f5d9e6b8 --- /dev/null +++ b/gen_annex_f.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +# create the "annex-f" file that maps stable names to section numbers + grep newlabel *.aux \ +| sed 's/\\newlabel{\([^}]*\)}.*TitleReference {\([^}]*\)}.*/\1 \2/' \ +| sed 's/\(Clause\|Annex\) //' \ +| grep -v "aux:tab:" \ +| grep -v "aux:fig:" \ +| sed 's/\(.*\).aux://' \ +| grep -v '^\\' \ +| sort > annex-f \ No newline at end of file diff --git a/gen_html_std.sh b/gen_html_std.sh deleted file mode 100755 index 68b4bd67a9..0000000000 --- a/gen_html_std.sh +++ /dev/null @@ -1,94 +0,0 @@ -#! /bin/sh - -mkdir -p build - -# check if we need to rebuild -cd cxxdraft-htmlgen - -echo "htmlgen $(git rev-parse HEAD)" > ../thisbuild.tmp - -cd ../draft - -echo "draft $(git rev-parse origin/main)" >> ../thisbuild.tmp - -cd .. - -if [ -f all.patch ] -then -sha1sum all.patch >> thisbuild.tmp -fi - -if [ -f htmlgen.patch ] -then -sha1sum htmlgen.patch >> thisbuild.tmp -fi - -if [ -f htmlgen_code.patch ] -then -sha1sum htmlgen_code.patch >> thisbuild.tmp -fi - - -if [ -f lastbuild.sig ] -then - cmp --silent lastbuild.sig thisbuild.tmp && rm thisbuild.tmp && exit 0 -fi - -# Build the standard -cd draft/source - -if [ -f ../../all.patch ] -then -git apply ../../all.patch -fi - -# create the "annex-f" file that maps stable names to section numbers - grep newlabel *.aux \ -| sed 's/\\newlabel{\([^}]*\)}.*TitleReference {\([^}]*\)}.*/\1 \2/' \ -| sed 's/\(Clause\|Annex\) //' \ -| grep -v "aux:tab:" \ -| grep -v "aux:fig:" \ -| sed 's/\(.*\).aux://' \ -| grep -v '^\\' \ -| sort > annex-f - -if [ -f ../../htmlgen.patch ] -then -git apply -3 ../../htmlgen.patch -fi -# Build the HTML -cd ../../cxxdraft-htmlgen - -if [ -f ../htmlgen_code.patch ] -then -git apply ../htmlgen_code.patch -fi - -# For WSL, need to bump the limit of open files -mylimit=9000 -sudo prlimit --nofile=$mylimit --pid $$; ulimit -n $mylimit - -rm -rf 14882 -cabal v2-update -cabal v2-build --allow-newer -cabal v2-run cxxdraft-htmlgen ../draft Bare - -rm -f ../build/*.html ../build/annex-f -find 14882/ -maxdepth 1 -type f -execdir cp '{}' ../../build/'{}'.html \; -rm -r 14882 - -# Fixup build -cd ../build -rm *.css *.png -rename 's/.html//' *.css.html *.png.html -mv index.html.html index.html -cp ../draft/source/annex-f ./ - -cd .. - -if [ -f build/full.html ] -then -mv thisbuild.tmp lastbuild.sig -else -rm thisbuild.tmp -fi diff --git a/gen_standard.sh b/gen_standard.sh new file mode 100755 index 0000000000..7a79cec7b6 --- /dev/null +++ b/gen_standard.sh @@ -0,0 +1,58 @@ +#! /bin/sh + +if [[ -z $1 || -z $2 ]]; then +standard="origin/main" +target="c++" +patch_file="htmlgen.patch" +else +standard="tags/$1" +target=$2 +patch_file="$1.patch" +fi + +mkdir -p "build/$target" + +# Build the standard +cd draft/source +echo "Updating standard to version $target" +git reset --hard +git checkout $target + +if [ -f ../../all.patch ] +then +git apply ../../all.patch +fi + +../../gen_annex_f.sh + +if [ -f ../../htmlgen.patch ] +then +git apply -3 ../../htmlgen.patch +fi +# Build the HTML +cd ../../cxxdraft-htmlgen + +if [ -f ../htmlgen_code.patch ] +then +git apply ../htmlgen_code.patch +fi + +# For WSL, need to bump the limit of open files +mylimit=9000 +sudo prlimit --nofile=$mylimit --pid $$; ulimit -n $mylimit + +rm -rf 14882 +cabal v2-update +cabal v2-build --allow-newer +cabal v2-run cxxdraft-htmlgen ../draft Bare + +rm -f ../build/$target/*.html ../build/$target/annex-f +find 14882/ -maxdepth 1 -type f -execdir cp '{}' ../../build/$target/'{}'.html \; +rm -r 14882 + +# Fixup build +cd ../build/$target +rm *.css *.png +rename 's/.html//' *.css.html *.png.html +mv index.html.html index.html +cp ../draft/source/annex-f ./ diff --git a/index.html b/index.html new file mode 100644 index 0000000000..cdd2a75977 --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + +C++ standards + +

C++ standard

+

Note that all of these are completely inofficial HTML versions of various C++ working papers. These are not ISO publications.

+ + + \ No newline at end of file