[gtk-doc] mkdb: recursively add items to annotation glossary



commit 6acf923ba2b29d4abe6645642f448c8121489888
Author: Stefan Kost <ensonic users sf net>
Date:   Fri Nov 27 16:10:13 2009 +0200

    mkdb: recursively add items to annotation glossary
    
    Some annotation docs, reference other annotations. Go over the annotations in
    loops until the glossary is self contained.

 gtkdoc-mkdb.in |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 57cb6a8..88ad8f9 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -970,9 +970,20 @@ sub OutputAnnotationGlossary {
     my $lastletter = " ";
     my $divopen = 0;
 
-    # TODO: if there are no annotations used return
+    # if there are no annotations used return
     return if (! keys(%AnnotationsUsed));
 
+    # add acronyms that are referenced from acronym text
+rerun:
+    foreach my $annotation (keys(%AnnotationsUsed)) {
+        if($AnnotationDefinition{$annotation} =~ m/<acronym>([\w ]+)<\/acronym>/) {
+            if (!exists($AnnotationsUsed{$1})) {
+                $AnnotationsUsed{$1} = 1;
+                goto rerun;
+            }
+        }
+    }
+
     open (OUTPUT, ">$new_glossary")
 	|| die "Can't create $new_glossary";
 



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