diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2015-06-17 11:54:09 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2015-06-17 12:00:37 +0200 |
commit | 4a9efdc49184df82a28b38534936f8dd5c5864a9 (patch) | |
tree | eaf4364b68b754477dd8d31261dd2f154c1235a9 /gtkdoc-mkdb.in | |
parent | 982461652b12cff424f574bf1802c22d46bba537 (diff) | |
download | gtk-doc-4a9efdc49184df82a28b38534936f8dd5c5864a9.tar.gz |
sgml: drop suport for docbook sgml via java
Remove it from configure, the tools and the docs.
Diffstat (limited to 'gtkdoc-mkdb.in')
-rwxr-xr-x | gtkdoc-mkdb.in | 213 |
1 files changed, 78 insertions, 135 deletions
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); |