# next_steps.t.html
# Includes: footer.html
-# head.html
+# head.html (contains 2 alternate sets of keywords)
# javascript.html
# translist.html
echo "There is no template in this directory." && exit 1
fi
-# Add the includes to the templates.
+## Add the includes to the templates.
+
while read name; do
-# echo $name
# Make sure there is a blank line before the first include, otherwise
# it will not be added properly.
- cp $name.t.html ../$name.html && sed -i '1i\\n' ../$name.html
-
+ sed '1i\\n' $name.t.html > ../$name.html
# List the includes.
grep '^<!-- include virtual="' ../$name.html |
sed 's%^.*include virtual="\([^"]\+\).*$%\1%' > $list
-
# Add the includes.
while read include; do
sed "1,/^<!-- include virtual=\"$include\"/!d" ../$name.html > $before
done < $list
done < $names
-# Create mac.html and windows.html from index.html.
+## Create mac.html and windows.html from index.html.
+
cp ../index.html ../mac.html
cp ../index.html ../windows.html
# add them to the list of page names.
echo 'mac' >> $names
echo 'windows' >> $names
-# Remove the irrelevant parts.
+## Remove the irrelevant parts.
+
while read name ; do
# Find out which deletions apply.
grep '^<!-- START DELETION' ../$name.html \
| grep -v "$name" \
| sed 's%^<!-- START DELETION \([0-9][0-9]\),.*$%\1%' > $list
echo $name
- # Delete.
+ # Make the deletions.
while read deletion; do
sed -i "/^<!-- START DELETION $deletion/, \
/^<!-- END DELETION $deletion/d" ../$name.html
done < $list
+ # Delete the markers and any extra blank lines at the end of the page.
sed -i '/^<!-- [A-Z]* DELETION/d' ../$name.html
- # Delete any extra blank lines at the end of the page.
sed -i ':a /^\n*$/ {$d; N; ba}' ../$name.html
done < $names