summaryrefslogtreecommitdiff
path: root/codegen/vulkan/scripts/checkXrefs
blob: 6d5dc7d73d86e607fcc87c00433c354283bd8f59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
#
# Copyright 2015-2021 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0

# 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