summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2012-09-29 13:05:08 -0400
committerShaun McCance <shaunm@gnome.org>2012-09-29 13:05:08 -0400
commit62b8d9cfaf13b736a3d63b947169b02ad2821d2f (patch)
tree2d344e95c1a8eb23e5b41d9644067bf2d748d04a
parent5e65ff52ac25269ca7e71dc85b152f15ef796402 (diff)
downloadyelp-tools-62b8d9cfaf13b736a3d63b947169b02ad2821d2f.tar.gz
yelp-check: Added links -i to ignore xrefs with hrefs
-rwxr-xr-xtools/yelp-check.in11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/yelp-check.in b/tools/yelp-check.in
index 629f9fc..a258290 100755
--- a/tools/yelp-check.in
+++ b/tools/yelp-check.in
@@ -108,6 +108,7 @@ yelp_usage_links () {
echo ""
echo "Options:"
echo " -c CACHE Use the existing Mallard cache CACHE"
+ echo " -i Ignore xrefs where href is present"
) 1>&2
}
yelp_usage_orphans () {
@@ -280,7 +281,11 @@ yelp_links_page () {
echo '<xsl:output method="text"/>'
echo '<xsl:template match="/mal:page">'
echo ' <xsl:variable name="page" select="@id"/>'
- echo ' <xsl:for-each select="//*[@xref]">'
+ if [ "x$check_links_ignore" = "x1" ]; then
+ echo ' <xsl:for-each select="//*[@xref][not(@href)]">'
+ else
+ echo ' <xsl:for-each select="//*[@xref]">'
+ fi
echo ' <xsl:variable name="xref" select="@xref"/>'
echo ' <xsl:variable name="linkid">'
echo ' <xsl:call-template name="mal.link.xref.linkid"/>'
@@ -312,6 +317,10 @@ yelp_links () {
check_cache_file="$1"
shift
;;
+ "-i")
+ shift
+ check_links_ignore="1"
+ ;;
*)
break
;;