Files
openide/xml/relaxng/scripts/update_html5_schema.sh
Piotr Tomiak 6e2eb7cb4c WEB-59275 WEB-46308 WEB-57978 Update HTML definitions - add slot and events
GitOrigin-RevId: e0b978d05bfda8fb56ffdd056b104ef874955a05
2023-02-01 14:31:58 +00:00

71 lines
1.3 KiB
Bash
Executable File

#! /bin/bash
set -o errexit
ROOT=$PWD
PATCHES="$ROOT/../src/resources/patches"
cd ../src/resources
rm -rf temp
rm -rf result
rm -rf browser-compat-data
mkdir temp
cd temp
echo ">>>>> Preparing validator build"
git clone https://github.com/validator/validator
cd validator
cd build
git apply "$PATCHES/patch_build.patch"
cd ..
echo
echo ">>>>> Building schema drivers"
python3 build/build.py build
echo
echo ">>>>> Collecting schemas"
cd ../..
mkdir result
mkdir result/html5
cp temp/validator/schema/*.rnc result
rsync -r --include=*.rnc temp/validator/schema/* result
rm -rf result/xhtml10
pwd
ruby ../../scripts/html5charref.rb > result/html5chars.ent
echo
echo ">>>>> Patching html5 schema"
cp patches/*.rnc result/html5
cd result
for f in `ls $PATCHES`
do
if [[ "$f" == 0*\.* ]]
then
echo "$f"
patch -p0 -u < "$PATCHES/$f"
fi
done
cd ..
echo
echo ">>>>> Moving items in place"
cp result/html5-all.rnc result/html5.rnc
cp result/xhtml5-all.rnc result/xhtml5.rnc
mv result/html5/LICENSE result
# Retain our SVG 2.0 support
cp -R html5-schema/svg20 result
# Remove unnecessary files
rm result/html5/.htaccess
rm result/html5/assertions.sch
rm result/mml3/Makefile
rm result/mml3/patch-vnu
# Update html5-schema dir
rm -rf html5-schema
mv result html5-schema
rm -rf temp