Vulkan-Docs/scripts/checkXrefs
Jon Leech 9a8314cd41 Restructure the repository to put the specification Makefile and
associated material at the top level, vk.xml and associated material in
xml/, and generated include and source files in include/vulkan/ and
src/ext_loader/, respectively (public issue 436).
2018-04-04 23:08:43 -07:00

22 lines
569 B
Bash
Executable File

#!/bin/sh
# checkXrefs - check internal links in a Vulkan HTML spec
# Usage: checkXrefs file.html
# Prints a list of internal hrefs with no corresponding anchors.
# (There are many anchors with no corresponding hrefs - this is OK).
xrefs=`tempfile`
ids=`tempfile`
sed -e 's/ href="#/\nhref="#/g' < $1 | \
grep 'href="#' | \
sed -e 's/href="#//g' -e 's/"[ >].*//g' | \
sort | uniq > $xrefs
sed -e 's/ id="/\nid="/g' < $1 | \
grep 'id="' | \
sed -e 's/id="//g' -e 's/"[ >].*//g' | \
sort | uniq > $ids
comm -23 $xrefs $ids
rm $xrefs $ids 1>&2