[yelp-tools] yelp-check: Added links -i to ignore xrefs with hrefs



commit 62b8d9cfaf13b736a3d63b947169b02ad2821d2f
Author: Shaun McCance <shaunm gnome org>
Date:   Sat Sep 29 13:05:08 2012 -0400

    yelp-check: Added links -i to ignore xrefs with hrefs

 tools/yelp-check.in |   11 ++++++++++-
 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
                 ;;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]