Re: gtkdoc-mkdb cleanup for xml



Toshio Kuratomi wrote:
> 
> Greetings, I'm trying to coerce mkdb into outputting valid xml-docbook
> as well as sgml-docbook.  I've currently got a patch that should clean up
> the output of gtkdoc with respects to both sgml and xml:
> 
> * Quote the value of the pgwide attribute to informaltable
> * Change "entity" to "ENTITY"
> * Close the anchor tag
> * Unrelated cleanups:
>   + --help option implemented
>   + quote 'module' and other cleanups to the options parsing
> 
> This seems to work fine for sgml-docbook V3 (openjade-1.3, modular
> stylesheets 1.59, docbook-dtd-3.0-sgml from redhat) jade will take the input
> as xml and give me almost correct output as well (albiet with quite a few
> errors yet)  I think my next step is to add a command line switch like
> --output-format=xml for some things that are conditional on xml vs sgml.
> Would you be interested in those patches as well?

Thanks for looking into this. We need to switch to XML for
GNOME 2.0, I think.

Your latest patch looks fine. (I've cc'ed the gtk-doc list in case
anyone wants to comment.)

A switch like '--xml' would be fine for the XML-specific stuff.

We also need to figure out how cross-references will work in the
new help system. We used to fix up the cross-references in the final
HTML, so we need a different solution now.

Damon



--- gtk-doc/gtkdoc-mkdb.in.fixup        Sun Apr 29 11:51:57 2001
+++ gtk-doc/gtkdoc-mkdb.in      Sun Apr 29 11:54:38 2001
@@ -39,23 +39,38 @@
 
 # name of documentation module
 my $MODULE;
-my $TMPL_DIR;
-my $SGML_OUTPUT_DIR;
 my @SOURCE_DIRS;
+my $SGML_OUTPUT_DIR;
+my $TMPL_DIR;
+my $PRINT_HELP;
 my $PRINT_VERSION;
 
-my %optctl = (module => \$MODULE,
+my %optctl = ('module' => \$MODULE,
              'source-dir' => \ SOURCE_DIRS,
              'output-dir' => \$SGML_OUTPUT_DIR,
              'tmpl-dir' => \$TMPL_DIR,
+             'help' => \$PRINT_HELP,
              'version' => \$PRINT_VERSION);
-GetOptions(\%optctl, "module=s", "source-dir:s", "output-dir:s",
"version");
+GetOptions(\%optctl, "module=s", "source-dir:s", "output-dir:s",
+           "tmpl-dir:s", "help", "version");
 
 if ($PRINT_VERSION) {
     print "@VERSION \n";
     exit 0;
 }
 
+if ($PRINT_HELP) {
+       print "gtkdoc-mkdb version @VERSION \n";
+       print "\n--module=MODULE_NAME   Name of the doc module being
parsed";
+    print "\n--source-dir=DIRNAME   Directories which contain inline
reference material";
+       print "\n                       May be used more than once for
multiple directories";
+    print "\n--output-dir=DIRNAME   Directory to put the generated
Docbook files in";
+    print "\n--tmpl-dir=DIRNAME     DIRECTORY in which template files
may be found";
+    print "\n--version              Print the version of this program";
+    print "\n--help                 Print this help\n";
+       exit 0;
+}
+
 my $ROOT_DIR = ".";
 
 # All the files are written in subdirectories beneath here.
@@ -175,7 +190,7 @@
     open (OUTPUT, ">$new_object_index")
        || die "Can't create $new_object_index";
     print (OUTPUT <<EOF);
-<informaltable pgwide=1 frame="none">
+<informaltable pgwide="1" frame="none">
 <tgroup cols="$cols">
 <colspec colwidth="1*">
 <colspec colwidth="1*">
@@ -286,7 +301,7 @@
            }
 
            if ($num_symbols > 0) {
-               $book_top .= "<!entity $section_id SYSTEM
\"sgml/$file\">\n";
+               $book_top .= "<!ENTITY $section_id SYSTEM
\"sgml/$file\">\n";
                $book_bottom .= "    &$section_id;\n";
 
                if ($section_includes eq "") {
@@ -558,7 +573,7 @@
        my %field_descrs = @$params;
        
            $desc .= <<EOF;
-<informaltable pgwide=1 frame="none" role="struct">
+<informaltable pgwide="1" frame="none" role="struct">
 <tgroup cols="2">
 <colspec colwidth="2*">
 <colspec colwidth="8*">
@@ -630,7 +645,7 @@
        my %member_descrs = @$params;
        
            $desc .= <<EOF;
-<informaltable pgwide=1 frame="none" role="enum">
+<informaltable pgwide="1" frame="none" role="enum">
 <tgroup cols="2">
 <colspec colwidth="2*">
 <colspec colwidth="8*">
@@ -925,7 +940,7 @@
        # Start a table if we need one.
        if ($params_desc || $returns) {
            $output .= <<EOF;
-<informaltable pgwide=1 frame="none" role="params">
+<informaltable pgwide="1" frame="none" role="params">
 <tgroup cols="2">
 <colspec colwidth="2*">
 <colspec colwidth="8*">




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