[gtk-doc] Support |[<!-- language="plain" --> ]|



commit 6a1615bf824d701911d067eed0e3241b0cea7fc1
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Oct 22 23:03:06 2015 -0400

    Support |[<!-- language="plain" --> ]|
    
    Sometimes, having a simple verbatim element (like <screen> in
    docbook) comes in handy. Since we don't allow direct xml markup
    in GTK+'s doc comments anymore, make
    
    |[<!-- language="plain -->
    ...
    ]|
    
    work for this case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756998

 gtkdoc-mkdb.in              |   11 +++++++++--
 tests/gobject/src/gobject.c |    5 +++++
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 4c38aaa..4cc9984 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -5432,15 +5432,22 @@ sub MarkDownOutputDocBook {
       $text = &MarkDownParseLines ($block->{"lines"}, $symbol, "quote");
       $output .= "<blockquote>\n$text</blockquote>\n";
     } elsif ($block->{"type"} eq "code") {
+      my $tag = "programlisting";
+
       if ($block->{"language"}) {
-        $output .= "<informalexample><programlisting language=\"" . $block->{"language"} . "\"><![CDATA[\n";
+        if ($block->{"language"} eq "plain") {
+          $output .= "<informalexample><screen><![CDATA[\n";
+          $tag = "screen";
+        } else {
+          $output .= "<informalexample><programlisting language=\"" . $block->{"language"} . 
"\"><![CDATA[\n";
+        }
       } else {
         $output .= "<informalexample><programlisting><![CDATA[\n";
       }
       foreach (@{$block->{"lines"}}) {
         $output .= &ReplaceEntities ($_, $symbol) . "\n";
       }
-      $output .= "]]></programlisting></informalexample>\n";
+      $output .= "]]></$tag></informalexample>\n";
     } elsif ($block->{"type"} eq "markup") {
       $text = &ExpandAbbreviations($symbol, $block->{"text"});
       $output .= $text."\n";
diff --git a/tests/gobject/src/gobject.c b/tests/gobject/src/gobject.c
index 67ccf51..b4f19f2 100644
--- a/tests/gobject/src/gobject.c
+++ b/tests/gobject/src/gobject.c
@@ -134,6 +134,11 @@
  *
  * <http://www.gnome.org/>
  *
+ * |[<!-- language="plain" -->
+ * switch
+ *  │
+ *  ╰── slider
+ * ]|
  */
 
 /**


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