Skip to content

Commit

Permalink
build old standards
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsche committed Apr 7, 2024
1 parent e85344a commit bc90cfb
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 98 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion draft
Submodule draft updated 178 files
11 changes: 11 additions & 0 deletions gen_annex_f.sh
Original file line number Diff line number Diff line change
@@ -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
94 changes: 0 additions & 94 deletions gen_html_std.sh

This file was deleted.

58 changes: 58 additions & 0 deletions gen_standard.sh
Original file line number Diff line number Diff line change
@@ -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 ./
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>C++ standards</head>
<body>
<h1>C++ standard</h1>
<p>Note that all of these are completely inofficial HTML versions of various C++ working papers. These are not ISO publications.</p>
<ul>
<li><a href="c++">Latest draft</a></li>
<li><a href="c++23">C++23 N4950</a></li>
<li><a href="c++20">C++20 N4868</a></li>
<li><a href="c++17">C++17 N4659</a></li>
<li><a href="c++14">C++14 N4140</a></li>
<li><a href="c++11">C++11 N3337</a></li>
</ul>
</body>
</html>

0 comments on commit bc90cfb

Please sign in to comment.