[gtk-doc] Use unicode line art instead of ascii art for hierarchy



commit 0357af2b2e16932a9ee27415c4948dfce95e8a4a
Author: William Jon McCann <william jon mccann gmail com>
Date:   Mon Feb 10 16:12:13 2014 -0500

    Use unicode line art instead of ascii art for hierarchy
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724099

 gtkdoc-mkdb.in  |   10 +++++++---
 style/style.css |    6 ++++++
 2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 6db6f9d..89ceef1 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -3330,15 +3330,19 @@ sub GetHierarchy {
         if ($level == 0) {
             $hierarchy .= "  $link_text\n";
         } else {
-#            $hierarchy .= ' ' x ($level * 6 - 3) . "|\n";
-            $hierarchy .= ' ' x ($level * 6 - 3) . "+----$link_text\n";
+            # Unicode chars for: ╰───
+            $hierarchy .= ' ' x ($level * 6 - 3) . "<phrase 
role=\"lineart\">&#9584;&#9472;&#9472;&#9472;&#9472;</phrase> $link_text\n";
         }
         $level++;
     }
     for ($i = 0; $i <= $#children; $i++) {
       my $id = &CreateValidSGMLID ($children[$i]);
       my $link_text = "<link linkend=\"$id\">$children[$i]</link>";
-      $hierarchy .= ' ' x ($level * 6 - 3) . "+----$link_text\n";
+      my $junction = "&#9500;"; # unicde for ├
+      if ($i == $#children) {
+        $junction = "&#9584;"; # unicode for ╰
+      }
+      $hierarchy .= ' ' x ($level * 6 - 3) . "<phrase role=\"lineart\">" . $junction . 
"&#9472;&#9472;&#9472;&#9472;</phrase> $link_text\n";
     }
     $hierarchy .= "</synopsis>\n";
 
diff --git a/style/style.css b/style/style.css
index 603b851..0328f77 100644
--- a/style/style.css
+++ b/style/style.css
@@ -336,6 +336,12 @@ h2 .extralinks, h3 .extralinks
   font-weight: normal;
 }
 
+.lineart
+{
+  color: #d3d7cf;
+  font-weight: normal;
+}
+
 .annotation
 {
   /* tango:aluminium 5 */


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