[gtk-doc] sgml: drop suport for docbook sgml via java



commit 4a9efdc49184df82a28b38534936f8dd5c5864a9
Author: Stefan Sauer <ensonic users sf net>
Date:   Wed Jun 17 11:54:09 2015 +0200

    sgml: drop suport for docbook sgml via java
    
    Remove it from configure, the tools and the docs.

 configure.ac                |   21 ----
 gtkdoc-mkdb.in              |  213 ++++++++++++++++---------------------------
 gtkdoc-mkhtml.in            |   44 ++-------
 help/manual/C/index.docbook |   24 ++---
 4 files changed, 100 insertions(+), 202 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1e1287b..1e092af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,24 +54,6 @@ AM_PATH_PYTHON([2.3],,[:])
 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
 
 dnl
-dnl Check for jade or openjade.
-dnl
-dnl We prefer to use openjade with the '-t sgml-raw' option, since '-t sgml'
-dnl adds a newline before the closing '>' of HTML tags. lynx can't parse
-dnl that, which is bad for accessibility.
-dnl
-SGML_FORMAT_TYPE=sgml-raw
-AC_PATH_PROG([JADE], [openjade])
-if test -z "$JADE"; then
-       SGML_FORMAT_TYPE=sgml
-       AC_PATH_PROG([JADE], [jade])
-       if test -z "$JADE"; then
-               AC_MSG_WARN([Could not find openjade or jade, so SGML is not supported])
-       fi
-fi
-AC_SUBST([SGML_FORMAT_TYPE])
-
-dnl
 dnl Check for xsltproc
 dnl
 AC_PATH_PROG([XSLTPROC], [xsltproc])
@@ -303,9 +285,6 @@ gtk-doc was configured with the following options:
 test "$PYTHON" != : \
     && AC_MSG_NOTICE([** Python based tools enabled, using $PYTHON]) \
     || AC_MSG_NOTICE([   Python based tools disabled])
-test -n "$JADE" \
-    && AC_MSG_NOTICE([** SGML support enabled, using $JADE]) \
-    || AC_MSG_NOTICE([   SGML support disabled, no jade processor available])
 test -n "$DBLATEX$FOP" \
     && AC_MSG_NOTICE([** XML PDF support enabled, using $DBLATEX$FOP]) \
     || AC_MSG_NOTICE([   XML PDF support disabled, no dblatex or fop available])
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 20defc2..5a3a3db 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -266,7 +266,7 @@ my $SIGNAL_FIELD_WIDTH = 16;
 my $PARAM_FIELD_COUNT = 2;
 
 # XML, SGML formatting helper
-my ($empty_element_end, $doctype_header);
+my $doctype_header;
 
 
 run() unless caller; # Run program unless loaded as a module
@@ -340,87 +340,60 @@ EOF
   
     @TRACE@(" ignore files: [$IGNORE_FILES]\n");
         
-    # autodetect output format
+    # check output format
     if (! defined($OUTPUT_FORMAT) || ($OUTPUT_FORMAT eq "")) {
-        if (!$MAIN_SGML_FILE) {
-            if (-e "${MODULE}-docs.xml") {
-                $OUTPUT_FORMAT = "xml";
-            } else {
-                $OUTPUT_FORMAT = "sgml";
-            }
-        } else {
-            if ($MAIN_SGML_FILE =~ m/.*\.(.*ml)$/i) {
-                $OUTPUT_FORMAT = lc($1);
-            }
-        }
-    
+        $OUTPUT_FORMAT = "xml";    
     } else {
         $OUTPUT_FORMAT = lc($OUTPUT_FORMAT);
     }
-  
-    if ($OUTPUT_FORMAT eq "sgml") {
-        print <<EOF;
-###############################################################################
-sgml support in gtk-doc is deprecated and will be removed from one of the next
-gtk-doc release.
-Please refer to the documentation "Modernizing the documentation"/"GTK-Doc 1.9".
-###############################################################################
-EOF
+    if ($OUTPUT_FORMAT ne "xml") {
+        die "Invalid format '$OUTPUT_FORMAT' passed to --output.format"
     }
     
-    @TRACE@(" output-format: [$OUTPUT_FORMAT]\n");
-  
-    if ($OUTPUT_FORMAT eq "xml") {
-        if (!$MAIN_SGML_FILE) {
-            # backwards compatibility
-            if (-e "${MODULE}-docs.sgml") {
-                $MAIN_SGML_FILE = "${MODULE}-docs.sgml";
-            } else {
-                $MAIN_SGML_FILE = "${MODULE}-docs.xml";
-            }
+    if (!$MAIN_SGML_FILE) {
+        # backwards compatibility
+        if (-e "${MODULE}-docs.sgml") {
+            $MAIN_SGML_FILE = "${MODULE}-docs.sgml";
+        } else {
+            $MAIN_SGML_FILE = "${MODULE}-docs.xml";
         }
-        $empty_element_end = "/>";
-    
-        if (-e $MAIN_SGML_FILE) {
-            open(INPUT, "<$MAIN_SGML_FILE") || die "Can't open $MAIN_SGML_FILE";
-            $doctype_header = "";
-            while (<INPUT>) {
-                if (/^\s*<(book|chapter|article)/) {
-                    # check that the top-level tag or the doctype decl contain the xinclude namespace decl
-                    if (($_ !~ m/http:\/\/www.w3.org\/200[13]\/XInclude/) && ($doctype_header !~ 
m/http:\/\/www.w3.org\/200[13]\/XInclude/m)) {
-                        $doctype_header = "";
-                    }
-                    last;
+    }
+
+    if (-e $MAIN_SGML_FILE) {
+        open(INPUT, "<$MAIN_SGML_FILE") || die "Can't open $MAIN_SGML_FILE";
+        $doctype_header = "";
+        while (<INPUT>) {
+            if (/^\s*<(book|chapter|article)/) {
+                # check that the top-level tag or the doctype decl contain the xinclude namespace decl
+                if (($_ !~ m/http:\/\/www.w3.org\/200[13]\/XInclude/) && ($doctype_header !~ 
m/http:\/\/www.w3.org\/200[13]\/XInclude/m)) {
+                    $doctype_header = "";
                 }
-                $doctype_header .= $_;
+                last;
             }
-            close(INPUT);
-            $doctype_header =~ s/<!DOCTYPE \w+/<!DOCTYPE refentry/;
-            # if there are SYSTEM ENTITIES here, we should prepend "../" to the path
-            # FIXME: not sure if we can do this now, as people already work-around the problem
-            # $doctype_header =~ s#<!ENTITY % ([a-zA-Z-]+) SYSTEM \"([^/][a-zA-Z./]+)\">#<!ENTITY % $1 
SYSTEM \"../$2\">#g;
-        } else {
-            $doctype_header =
-    "<?xml version=\"1.0\"?>\n" .
-    "<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.3//EN\"\n" .
-    "               \"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\"\n"; .
-    "[\n" .
-    "  <!ENTITY % local.common.attrib \"xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'\">\n" .
-    "]>\n";
+            $doctype_header .= $_;
         }
+        close(INPUT);
+        $doctype_header =~ s/<!DOCTYPE \w+/<!DOCTYPE refentry/;
+        # if there are SYSTEM ENTITIES here, we should prepend "../" to the path
+        # FIXME: not sure if we can do this now, as people already work-around the problem
+        # $doctype_header =~ s#<!ENTITY % ([a-zA-Z-]+) SYSTEM \"([^/][a-zA-Z./]+)\">#<!ENTITY % $1 SYSTEM 
\"../$2\">#g;
     } else {
-        if (!$MAIN_SGML_FILE) {
-            $MAIN_SGML_FILE = "${MODULE}-docs.sgml";
-        }
-        $empty_element_end = ">";
-        $doctype_header = "";
-    } 
+        $doctype_header = <<EOF;
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd";
+[
+  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
+]>
+EOF
+    }
+    chomp($doctype_header);
     
     # All the files are written in subdirectories beneath here.
     $TMPL_DIR = $TMPL_DIR ? $TMPL_DIR : "$ROOT_DIR/tmpl";
     
     # This is where we put all the DocBook output.
-    $DB_OUTPUT_DIR = $DB_OUTPUT_DIR ? $DB_OUTPUT_DIR : "$ROOT_DIR/$OUTPUT_FORMAT";
+    $DB_OUTPUT_DIR = $DB_OUTPUT_DIR ? $DB_OUTPUT_DIR : "$ROOT_DIR/xml";
   
     # This file contains the object hierarchy.
     $OBJECT_TREE_FILE = "$ROOT_DIR/$MODULE.hierarchy";
@@ -541,27 +514,24 @@ EOF
 sub OutputObjectList {
     my $cols = 3;
 
-    # FIXME: use $OUTPUT_FORMAT
-    # my $old_object_index = "$DB_OUTPUT_DIR/object_index.$OUTPUT_FORMAT";
+    # FIXME: use .xml
+    # my $old_object_index = "$DB_OUTPUT_DIR/object_index.xml";
     my $old_object_index = "$DB_OUTPUT_DIR/object_index.sgml";
     my $new_object_index = "$DB_OUTPUT_DIR/object_index.new";
 
     open (OUTPUT, ">$new_object_index")
         || die "Can't create $new_object_index: $!";
 
-    if ($OUTPUT_FORMAT eq "xml") {
-        my $header = $doctype_header;
-
-        $header =~ s/<!DOCTYPE \w+/<!DOCTYPE informaltable/;
-        print (OUTPUT "$header");
-    }
+    my $header = $doctype_header;
+    $header =~ s/<!DOCTYPE \w+/<!DOCTYPE informaltable/;
 
     print (OUTPUT <<EOF);
+$header
 <informaltable pgwide="1" frame="none">
 <tgroup cols="$cols">
-<colspec colwidth="1*"${empty_element_end}
-<colspec colwidth="1*"${empty_element_end}
-<colspec colwidth="1*"${empty_element_end}
+<colspec colwidth="1*"/>
+<colspec colwidth="1*"/>
+<colspec colwidth="1*"/>
 <tbody>
 EOF
 
@@ -722,12 +692,7 @@ sub OutputDB {
             @TRACE@("End of section: $title\n");
             if ($num_symbols > 0) {
                 # collect documents
-                if ($OUTPUT_FORMAT eq "xml") {
-                    $book_bottom .= "    <xi:include href=\"xml/$filename.xml\"/>\n";
-                } else {
-                    $book_top.="<!ENTITY $section_id SYSTEM \"sgml/$filename.sgml\">\n";
-                    $book_bottom .= "    &$section_id;\n";
-                }
+                $book_bottom .= "    <xi:include href=\"xml/$filename.xml\"/>\n";
 
                 if (defined ($SourceSymbolDocs{"$TMPL_DIR/$filename:Include"})) {
                     if ($section_includes) {
@@ -1114,7 +1079,7 @@ sub OutputIndex {
     my $header = $doctype_header;
     $header =~ s/<!DOCTYPE \w+/<!DOCTYPE indexdiv/;
 
-    print (OUTPUT "$header<indexdiv id=\"$basename\">\n");
+    print (OUTPUT "$header\n<indexdiv id=\"$basename\">\n");
 
     @TRACE@("generate $basename index (".%apiindex." entries)\n");
 
@@ -2557,8 +2522,8 @@ sub OutputDBFile {
 
     my $extralinks = OutputSectionExtraLinks($title,"Section:$file");
 
-    my $old_db_file = "$DB_OUTPUT_DIR/$file.$OUTPUT_FORMAT";
-    my $new_db_file = "$DB_OUTPUT_DIR/$file.$OUTPUT_FORMAT.new";
+    my $old_db_file = "$DB_OUTPUT_DIR/$file.xml";
+    my $new_db_file = "$DB_OUTPUT_DIR/$file.xml.new";
 
     open (OUTPUT, ">$new_db_file")
         || die "Can't create $new_db_file: $!";
@@ -2568,7 +2533,7 @@ sub OutputDBFile {
         next if ($object eq $section_id);
         my $id = CreateValidSGMLID($object);
         @TRACE@("Adding anchor for $object\n");
-        $object_anchors .= "<anchor id=\"$id\"$empty_element_end";
+        $object_anchors .= "<anchor id=\"$id\"/>";
     }
 
     # Make sure we produce valid docbook
@@ -2578,11 +2543,8 @@ sub OutputDBFile {
     # since it changes every day (and it is only used in the man pages):
     # "<refentry id="$section_id" revision="$mday $month $year">"
 
-    if ($OUTPUT_FORMAT eq "xml") {
-        print OUTPUT $doctype_header;
-    }
-
     print OUTPUT <<EOF;
+$doctype_header
 <refentry id="$section_id">
 <refmeta>
 <refentrytitle role="top_of_page" id="$section_id.top_of_page">$title</refentrytitle>
@@ -2688,29 +2650,15 @@ sub OutputBook {
     # If the main docbook file hasn't been created yet, we create it here.
     # The user can tweak it later.
     if ($MAIN_SGML_FILE && ! -e $MAIN_SGML_FILE) {
-      open (OUTPUT, ">$MAIN_SGML_FILE")
-        || die "Can't create $MAIN_SGML_FILE: $!";
-
-      if ($OUTPUT_FORMAT eq "xml") {
-          print OUTPUT <<EOF;
-<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
-               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd";
-[
-  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
-]>
-<book id="index">
-EOF
-      } else {
+        open (OUTPUT, ">$MAIN_SGML_FILE")
+          || die "Can't create $MAIN_SGML_FILE: $!";
+          
+        my $header = $doctype_header;
+        $header =~ s/<!DOCTYPE \w+/<!DOCTYPE book/;
+  
         print OUTPUT <<EOF;
-<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-$book_top
-]>
+$header
 <book id="index">
-EOF
-      }
-
-print OUTPUT <<EOF;
   <bookinfo>
     <title>$MODULE Reference Manual</title>
     <releaseinfo>
@@ -2725,15 +2673,15 @@ print OUTPUT <<EOF;
     $book_bottom
   </chapter>
 EOF
-  if (-e $OBJECT_TREE_FILE) {
-    print OUTPUT <<EOF;
+        if (-e $OBJECT_TREE_FILE) {
+            print OUTPUT <<EOF;
   <chapter id="object-tree">
     <title>Object Hierarchy</title>
     <xi:include href="xml/tree_index.sgml"/>
   </chapter>
 EOF
-  } else {
-    print OUTPUT <<EOF;
+        } else {
+            print OUTPUT <<EOF;
   <!-- enable this when you use gobject types
   <chapter id="object-tree">
     <title>Object Hierarchy</title>
@@ -2741,9 +2689,8 @@ EOF
   </chapter>
   -->
 EOF
-  }
-
-print OUTPUT <<EOF;
+        }
+        print OUTPUT <<EOF;
   <index id="api-index-full">
     <title>API Index</title>
     <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
@@ -2753,22 +2700,22 @@ print OUTPUT <<EOF;
     <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
   </index>
 EOF
-  if (keys(%AnnotationsUsed)) {
-    print OUTPUT <<EOF;
+        if (keys(%AnnotationsUsed)) {
+            print OUTPUT <<EOF;
   <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
 EOF
-  } else {
-    print OUTPUT <<EOF;
+        } else {
+            print OUTPUT <<EOF;
   <!-- enable this when you use gobject introspection annotations
   <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
   -->
 EOF
-  }
-  print OUTPUT <<EOF;
+        }
+        print OUTPUT <<EOF;
 </book>
 EOF
 
-      close (OUTPUT);
+        close (OUTPUT);
     }
 }
 
@@ -5976,21 +5923,17 @@ sub ReadObjectHierarchy {
     }
     close (INPUT);
 
-    # FIXME: use $OUTPUT_FORMAT
-    # my $old_tree_index = "$DB_OUTPUT_DIR/tree_index.$OUTPUT_FORMAT";
+    # FIXME: use xml
+    # my $old_tree_index = "$DB_OUTPUT_DIR/tree_index.$xml";
     my $old_tree_index = "$DB_OUTPUT_DIR/tree_index.sgml";
     my $new_tree_index = "$DB_OUTPUT_DIR/tree_index.new";
 
     open (OUTPUT, ">$new_tree_index")
         || die "Can't create $new_tree_index: $!";
 
-    if ($OUTPUT_FORMAT eq "xml") {
-        my $tree_header = $doctype_header;
-
-        $tree_header =~ s/<!DOCTYPE \w+/<!DOCTYPE screen/;
-        print (OUTPUT "$tree_header");
-    }
-    print (OUTPUT "<screen>\n" . &AddTreeLineArt(\ tree) . "\n</screen>\n");
+    my $header = $doctype_header;
+    $header =~ s/<!DOCTYPE \w+/<!DOCTYPE screen/;
+    print (OUTPUT "$header\n<screen>\n" . &AddTreeLineArt(\ tree) . "\n</screen>\n");
     close (OUTPUT);
 
     &UpdateFileIfChanged ($old_tree_index, $new_tree_index, 0);
diff --git a/gtkdoc-mkhtml.in b/gtkdoc-mkhtml.in
index 5f171be..5012669 100644
--- a/gtkdoc-mkhtml.in
+++ b/gtkdoc-mkhtml.in
@@ -68,21 +68,13 @@ else
     styledir=$gtkdocdir
 fi
 
-if head -n 1 $document | grep "<?xml" > /dev/null; then
-    is_xml=true
-    path_option='--path'
-else
-    is_xml=false
-    path_option='--directory'
-fi
-
 # we could do "$path_option $PWD "
 # to avoid needing rewriting entities that are copied from the header
 # into docs under xml
 if test "X$searchpath" = "X"; then
     path_arg=
 else
-    path_arg="$path_option $searchpath"
+    path_arg="--path $searchpath"
 fi
 
 # Delete the old index.sgml file, if it exists.
@@ -90,30 +82,16 @@ if test -f index.sgml; then
   rm -f index.sgml
 fi
 
-if $is_xml; then
-    #echo @XSLTPROC@ $path_arg --nonet --xinclude \
-    #    --stringparam gtkdoc.bookname $module \
-    #    --stringparam gtkdoc.version "@VERSION@" \
-    #    "$@" $gtkdocdir/gtk-doc.xsl $document
-    @XSLTPROC@ $path_arg --nonet --xinclude \
-        --stringparam gtkdoc.bookname $module \
-        --stringparam gtkdoc.version "@VERSION@" \
-        --stringparam chunk.quietly $quiet \
-        --stringparam chunker.output.quiet $quiet \
-        "$@" $gtkdocdir/gtk-doc.xsl $document || exit $?
-else
-    echo <<EOF;
-###############################################################################
-sgml support in gtk-doc is deprecated and will be removed from one of the next
-gtk-doc release.
-Please refer to the documentation "Modernizing the documentation"/"GTK-Doc 1.9".
-###############################################################################
-EOF
-
-    @JADE@ $path_arg -t @SGML_FORMAT_TYPE@ -w no-idref -d $gtkdocdir/gtk-doc.dsl \
-        -V "gtkdoc-bookname=$module" -V "gtkdoc-version= VERSION@" \
-        "$@" $gtkdocdir/gtk-doc.dcl $document || exit $?
-fi
+#echo @XSLTPROC@ $path_arg --nonet --xinclude \
+#    --stringparam gtkdoc.bookname $module \
+#    --stringparam gtkdoc.version "@VERSION@" \
+#    "$@" $gtkdocdir/gtk-doc.xsl $document
+ XSLTPROC@ $path_arg --nonet --xinclude \
+    --stringparam gtkdoc.bookname $module \
+    --stringparam gtkdoc.version "@VERSION@" \
+    --stringparam chunk.quietly $quiet \
+    --stringparam chunker.output.quiet $quiet \
+    "$@" $gtkdocdir/gtk-doc.xsl $document || exit $?
 
 # copy navigation images and stylesheets to html directory ...
 cp -f $styledir/*.png $styledir/*.css ./
diff --git a/help/manual/C/index.docbook b/help/manual/C/index.docbook
index 8476300..9564620 100644
--- a/help/manual/C/index.docbook
+++ b/help/manual/C/index.docbook
@@ -278,26 +278,24 @@
 
         <listitem>
           <para>
-            <guilabel>Generating the SGML/XML and HTML/PDF.</guilabel>
+            <guilabel>Generating the XML and HTML/PDF.</guilabel>
 
             <application>gtkdoc-mkdb</application> turns the template files into
-            SGML or XML files in the <filename class='directory'>sgml/</filename>
-            or <filename class='directory'>xml/</filename> subdirectory.
+            XML files in the <filename class='directory'>xml/</filename> subdirectory.
             If the source code contains documentation on functions, using the
             special comment blocks, it gets merged in here. If there are no tmpl files used
-            it only reads docs from sources and introspection data. We recommend
-            to use Docbook XML.
+            it only reads docs from sources and introspection data.
           </para>
           <para>
-            <application>gtkdoc-mkhtml</application> turns the SGML/XML files into HTML
+            <application>gtkdoc-mkhtml</application> turns the XML files into HTML
             files in the <filename class='directory'>html/</filename> subdirectory.
-            Likewise <application>gtkdoc-mkpdf</application> turns the SGML/XML files into a PDF
+            Likewise <application>gtkdoc-mkpdf</application> turns the XML files into a PDF
             document called <filename>&lt;package&gt;.pdf</filename>.
           </para>
           <para>
-            Files in <filename class='directory'>sgml/</filename> or
-            <filename class='directory'>xml/</filename> and <filename class='directory'>html/</filename>
-            directories are always overwritten. One should never edit them directly.
+            Files in <filename class='directory'>xml/</filename> and 
+            <filename class='directory'>html/</filename> directories are always
+            overwritten. One should never edit them directly.
           </para>
         </listitem>
 
@@ -822,8 +820,8 @@ gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html
       <para>
         In older GTK-Doc releases, if you need support for additional
         formatting, you would need to enable the usage of docbook
-        SGML/XML tags inside doc-comments by putting <option>--xml-mode</option> 
-        or <option>--sgml-mode</option> in the variable
+        XML tags inside doc-comments by putting <option>--xml-mode</option> 
+        (or <option>--sgml-mode</option>) in the variable
         <symbol>MKDB_OPTIONS</symbol> inside <filename>Makefile.am</filename>.
       </para>
 
@@ -1610,7 +1608,7 @@ gtk_arrow_get_type
         without any suffix. For example, using '&lt;FILE&gt;gnome-config&lt;/FILE&gt;'
         will result in the section declarations being output in the template
         file <filename>tmpl/gnome-config.sgml</filename>, which will be
-        converted into the DocBook SGML/XML file <filename>sgml/gnome-config.sgml</filename>
+        converted into the DocBook XML file <filename>xml/gnome-config.sgml</filename>
         or the DocBook XML file <filename>xml/gnome-config.xml</filename>.
         (The name of the HTML file is based on the module name and the section
         title, or for GObjects it is based on the GObjects class name converted


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