[gtk-doc] sgml: remove docbook sgml tools



commit d77af067190867c04cb33fc43f26f943ba81f1b1
Author: Stefan Sauer <ensonic users sf net>
Date:   Tue Mar 21 22:29:17 2017 +0100

    sgml: remove docbook sgml tools
    
    We remove jade support already a few versions ago. Also remove the tools we've
    called from the pdf/man generators. For most of them configure was never
    checking the pre-requisites.

 Makefile.am              |    3 -
 db2man/README            |   14 -
 db2man/docbook-to-man    |  178 ----
 db2man/docbook-to-man.ts | 2019 ----------------------------------------------
 doc/design-2.x.txt       |    7 -
 gtkdoc-mkman.in          |   55 +-
 gtkdoc-mkpdf.in          |  119 ++--
 7 files changed, 73 insertions(+), 2322 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 86c44df..a757036 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,9 +68,6 @@ EXTRA_DIST = \
        doc/sections-file.txt \
        doc/setting-up.txt    \
        doc/style-guide.txt   \
-       db2man/README            \
-       db2man/docbook-to-man    \
-       db2man/docbook-to-man.ts \
        examples/README       \
        examples/Makefile.am  \
        tools/docpercentages.pl \
diff --git a/doc/design-2.x.txt b/doc/design-2.x.txt
index 7c0d319..04cffb6 100644
--- a/doc/design-2.x.txt
+++ b/doc/design-2.x.txt
@@ -7,7 +7,6 @@ Its not about Gtk. Its about C APIs with GObject support.
 g-doc, gapi-doc, gnome-api-doc, ...
 
 == remove and deprecate =
-- get rid of sgml, we will only use docbook xml
 - rename generated index.sgml to something like index.idx - it is not wellformed
   sgml
 - in the makefiles
@@ -64,9 +63,3 @@ If the ID contain a ':' xml processors belive it is using a namespace.
   (or an option to specifically name it)
 
 === markup ===
-- use a wiki syntax: http://www.wikicreole.org/
-  - we need a template syntax on top of that for the various boxes (function, macro, struct, ...)
-- perl module avaible: http://www.wikicreole.org/wiki/TextWikiCreole
-  http://search.cpan.org/~jburnett/Text-WikiCreole/
-  - we would need to extend it to return docbook xml
-
diff --git a/gtkdoc-mkman.in b/gtkdoc-mkman.in
index 6667301..0f190b5 100644
--- a/gtkdoc-mkman.in
+++ b/gtkdoc-mkman.in
@@ -44,14 +44,6 @@ else:
     datarootdir='@datarootdir@'
     gtkdocdir='@datadir@/gtk-doc/data'
 
-if "<?xml" in open(document).readline():
-    is_xml=True
-    path_option='--path'
-else:
-    is_xml=False
-    path_option='--directory'
-
-
 # we could do "$path_option $PWD "
 # to avoid needing rewriting entities that are copied from the header
 # into docs under xml
@@ -60,32 +52,23 @@ if options.path == '':
 else:
     path_arg=[path_option, options.path]
 
-# would it make sens to create man pages only for certain refentries
+# would it make sense to create man pages only for certain refentries
 # e.g. for tools
-if is_xml:
-    # see http://bugzilla.gnome.org/show_bug.cgi?id=467488
-    subprocess.check_call([xsltproc] + path_arg +[
-        '--nonet',
-        '--xinclude',
-        '--stringparam',
-        'gtkdoc.bookname',
-        module,
-        '--stringparam',
-        'gtkdoc.version',
-        version,
-        '--stringparam',
-        'chunk.quietly ',
-        'quiet',
-        '--stringparam',
-        'chunker.output.quiet',
-        quiet,
-        'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
-        document])
-else:
-    for i in glob('sgml/*.sgml'):
-        j = os.path.split(i)[1].replace('.sgml', '.man')
-        print("converting ", i, j)
-        subproject.check_call(['docbook-to-man', i],
-                               stdout=open('man'+j),
-                               stderr=open('man/%s.log' % j))
-
+# see http://bugzilla.gnome.org/show_bug.cgi?id=467488
+subprocess.check_call([xsltproc] + path_arg +[
+    '--nonet',
+    '--xinclude',
+    '--stringparam',
+    'gtkdoc.bookname',
+    module,
+    '--stringparam',
+    'gtkdoc.version',
+    version,
+    '--stringparam',
+    'chunk.quietly ',
+    quiet,
+    '--stringparam',
+    'chunker.output.quiet',
+    quiet,
+    'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
+    document])
diff --git a/gtkdoc-mkpdf.in b/gtkdoc-mkpdf.in
index 5dcf758..19dfc78 100755
--- a/gtkdoc-mkpdf.in
+++ b/gtkdoc-mkpdf.in
@@ -54,88 +54,77 @@ else:
     datarootdir='@datarootdir@'
     gtkdocdir='@datadir@'/gtk-doc/data
 
-if "<?xml" in open(document).readline():
-    is_xml=True
-    path_option='--path'
-else:
-    is_xml=False
-    path_option='--directory'
-
 # We need to use a wrapper because there's no other way to conditionally pass
 # a `--path $searchpath` argument with proper quoting for the path
 def run_xsltproc(args):
     global options, xsltproc
-    # we could do "$path_option $PWD "
+    # we could do "--path $PWD "
     # to avoid needing rewriting entities that are copied from the header
     # into docs under xml
     if len(options.path) == 0:
         cmd = [xsltproc] + args
     else:
-        cmd = [xsltproc, path_option] + options.searchpath + args
+        cmd = [xsltproc, '--path'] + options.searchpath + args
     pc = subprocess.Popen(cmd, stderr=subprocess.PIPE)
     (o, stde) = pc.communicate()
     open('profile.txt', 'wb').write(stde)
     if pc.returncode != 0:
         cleanexit(pc.returncode)
 
-if is_xml:
-    if dblatex != '':
-        # extra options to consider
-        # -I FIG_PATH
-        # -V is useful for debugging
-        # -T db2latex : different style
-        # -d : keep transient files (for debugging)
-        # -P abc.def=$quiet : once the stylesheets have a quiet mode
-        # xsltproc is already called with --xinclude
-        # does not work: --xslt-opts "$path_option $searchpath --nonet $@"
-        dblatex_options=['-o', module + '.pdf']
-        for i in options.imgdir:
-            dblatex_options += ['-I', i]
-        dblatex_options.append(document)
-        #echo "calling: @DBLATEX@ $dblatex_options"
-        if not options.verbose:
-            pc = subprocess.Popen([dblatex, '--help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-            (stdo, stde) = pc.communicate()
-            if b'--quiet' in stdo or b'--quiet' in stde:
-                dblatex_options= ['--quiet'] + dblatex_options
-        dbcmd = [dblatex] + dblatex_options
-        pc = subprocess.Popen(dbcmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-        (stde, _) = pc.communicate()
-        for line in stde.split('\n'):
-            if 'programlisting or screen' not in line and line.strip():
-                print(line)
+if dblatex != '':
+    # extra options to consider
+    # -I FIG_PATH
+    # -V is useful for debugging
+    # -T db2latex : different style
+    # -d : keep transient files (for debugging)
+    # -P abc.def=$quiet : once the stylesheets have a quiet mode
+    # xsltproc is already called with --xinclude
+    # does not work: --xslt-opts "--path $searchpath --nonet $@"
+    dblatex_options=['-o', module + '.pdf']
+    for i in options.imgdir:
+        dblatex_options += ['-I', i]
+    dblatex_options.append(document)
+    if not options.verbose:
+        pc = subprocess.Popen([dblatex, '--help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+        (stdo, stde) = pc.communicate()
+        if b'--quiet' in stdo or b'--quiet' in stde:
+            dblatex_options= ['--quiet'] + dblatex_options
+    dbcmd = [dblatex] + dblatex_options
+    pc = subprocess.Popen(dbcmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+    (stde, _) = pc.communicate()
+    for line in stde.split('\n'):
+        if 'programlisting or screen' not in line and line.strip():
+            print(line)
+elif fop != '':
+    if options.verbose:
+        quiet = '0'
     else:
-        if fop != '':
-            run_xsltproc(['--nonet',
-                          '--xinclude',
-                          '--stringparam',
-                          'gtkdoc.bookname',
-                          module,
-                          '--stringparam',
-                          'gtkdoc.version',
-                          version,
-                          '--stringparam',
-                          'chunk.quietly',
-                          options.quiet,
-                          '--stringparam',
-                          'chunker.output.quiet',
-                          quiet,
-                          module,
-                          document,
-                          '-o',
-                          module + '.fo',
-                          gtkdocdir + '/gtk-doc-fo.xsl',
-                          document])
-            # fop dies too easily :(
-            # @FOP@ $module.fo $module.pdf
-        else:
-            print("dblatex or fop must be installed to use gtkdoc-mkpdf.")
-            cleanexit(1)
+        quiet = '1'
+    run_xsltproc(['--nonet',
+                  '--xinclude',
+                  '--stringparam',
+                  'gtkdoc.bookname',
+                  module,
+                  '--stringparam',
+                  'gtkdoc.version',
+                  version,
+                  '--stringparam',
+                  'chunk.quietly',
+                  quiet,
+                  '--stringparam',
+                  'chunker.output.quiet',
+                  quiet,
+                  module,
+                  document,
+                  '-o',
+                  module + '.fo',
+                  gtkdocdir + '/gtk-doc-fo.xsl',
+                  document])
+    # fop dies too easily :(
+    # @FOP@ $module.fo $module.pdf
 else:
-    # not very good output
-    # also for xxx-docs.sgml it will produce xxx-docs.pdf
-    subprocess.check_call(['docbook2pdf', '-e', 'no-valid', document])
+    print("dblatex or fop must be installed to use gtkdoc-mkpdf.")
+    cleanexit(1)
 
 open('pdf.stamp', 'w').write('timestamp')
 cleanexit(0)
-


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