bug-texinfo
[Top][All Lists]
Advanced

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

another makeinfo docbook patch


From: Per Bothner
Subject: another makeinfo docbook patch
Date: Sun, 14 Aug 2005 17:24:47 -0700
User-agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)

The avoids a mark attribute it a <itemizedlist> if the item_function
was implicitly @bullet.  This avoids a complication since docbook-xslt
doesn't translate mark names, and bullet isn't a valid html item name,
which prevented validation.

If you want to see a preview of the result:
http://per.bothner.com/tmp/kawa/index.html
This makes use of an manual written in texinfo, converted to docbook
using makeinfo, and then converted to html using docbook-xslt plus
some scripts and css.
If you're curious how it works, look at the Makefile, and specifically
the 'manual' rule in:  http://per.bothner.com/tmp/kawa/Makefile

(This is an unstable preview of the new Kawa website, and it
will go away when the main site http://www.gnu.rog/software/kawa
is updated after Kawa 1.8 is released.)
--
        --Per Bothner
address@hidden   http://per.bothner.com/
Index: ChangeLog
===================================================================
RCS file: /cvsroot/texinfo/texinfo/ChangeLog,v
retrieving revision 1.528
diff -u -p -r1.528 ChangeLog
--- ChangeLog   13 Aug 2005 15:58:08 -0000      1.528
+++ ChangeLog   15 Aug 2005 00:16:03 -0000
@@ -1,3 +1,15 @@
+2005-08-14  Per Bothner  <address@hidden>
+
+       * makeinfo/index.c (cm_printindex): Don't defer index if docbook,
+       since we don't need it and it prevents output to a pipe.
+
+       * makeinfo/insertion.h (default_item_function): New declaration.
+       * makeinfo/insertion.c (default_item_function): New variable.
+       (begin_insertion): Use default_item_function for @bullet default.
+       (pop_insertion): Check if item_function is default_item_function.
+       * makeinfo/xml.c (xml_begin_table): Don't emit mark attribute
+       if the item_function was implied.
+
 2005-08-13  Karl Berry  <address@hidden>
 
        * doc/texinfo.tex (\writetocentry, ...): restore calls to
@@ -479,7 +491,7 @@
 
        * makeinfo/xml.c (docbook_element_list): Add two missing entries.
 
-       * makeinfo/xml.c (xml_begin_document): Check for mipatch between
+       * makeinfo/xml.c (xml_begin_document): Check for mismatch between
        enum xml_element and texinfoml_element_list/docbook_element_list.
 
        bug-texinfo-mail, 05 Feb 2005 00:13:44 -0800.
Index: makeinfo/index.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/index.c,v
retrieving revision 1.19
diff -u -p -r1.19 index.c
--- makeinfo/index.c    6 Aug 2005 16:04:37 -0000       1.19
+++ makeinfo/index.c    15 Aug 2005 00:16:03 -0000
@@ -711,10 +711,11 @@ cm_printindex (void)
   if (!handling_delayed_writes)
     line_number--;
 
-  if (xml && !docbook)
+  if (xml)
     {
       xml_insert_element (PRINTINDEX, START);
-      insert_string (index_name);
+      if (! docbook)
+       insert_string (index_name);
       xml_insert_element (PRINTINDEX, END);
     }
   else if (!handling_delayed_writes)
@@ -723,9 +724,6 @@ cm_printindex (void)
       char *index_command = xmalloc (command_len + 1);
 
       close_paragraph ();
-      if (docbook)
-        xml_begin_index ();
-
       sprintf (index_command, "@%s %s", command, index_name);
       register_delayed_write (index_command);
       free (index_command);
Index: makeinfo/insertion.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/insertion.c,v
retrieving revision 1.59
diff -u -p -r1.59 insertion.c
--- makeinfo/insertion.c        15 May 2005 00:00:07 -0000      1.59
+++ makeinfo/insertion.c        15 Aug 2005 00:16:03 -0000
@@ -79,6 +79,8 @@ static int raw_output_block = 0;
 /* Non-zero if a <dl> element has a <dt> element in it.  We use this when
    deciding whether to insert a <br> or not.  */
 static int html_deflist_has_term = 0;
+
+const char default_item_function[] = { "@bullet" };
 
 void
 init_insertion_stack (void)
@@ -209,7 +211,10 @@ pop_insertion (void)
   inhibit_paragraph_indentation = temp->inhibited;
   filling_enabled = temp->filling_enabled;
   indented_fill = temp->indented_fill;
-  free_and_clear (&(temp->item_function));
+  if (temp->item_function == default_item_function)
+    temp->item_function = NULL;
+  else
+    free_and_clear (&(temp->item_function));
   free_and_clear (&(temp->filename));
   insertion_stack = insertion_stack->next;
   free (temp);
@@ -622,7 +627,7 @@ begin_insertion (enum insertion_type typ
           if (!(*insertion_stack->item_function))
             {
               free (insertion_stack->item_function);
-              insertion_stack->item_function = xstrdup ("@bullet");
+              insertion_stack->item_function = default_item_function;
             }
         }
 
Index: makeinfo/insertion.h
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/insertion.h,v
retrieving revision 1.11
diff -u -p -r1.11 insertion.h
--- makeinfo/insertion.h        15 May 2005 00:00:07 -0000      1.11
+++ makeinfo/insertion.h        15 Aug 2005 00:16:03 -0000
@@ -35,6 +35,8 @@ enum insertion_type
   table, tex, vtable, titlepage, bad_type
 };
 
+extern const char default_item_function[];
+
 typedef struct istack_elt
 {
   struct istack_elt *next;
Index: makeinfo/xml.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/xml.c,v
retrieving revision 1.61
diff -u -p -r1.61 xml.c
--- makeinfo/xml.c      6 Aug 2005 16:04:37 -0000       1.61
+++ makeinfo/xml.c      15 Aug 2005 00:16:04 -0000
@@ -1424,11 +1424,17 @@ xml_begin_table (int type, char *item_fu
         }
       break;
     case itemize:
+      if (!docbook || item_function==default_item_function)
+       xml_insert_element (ITEMIZE, START);
+      else
+       xml_insert_element_with_attribute (ITEMIZE, START,
+                                          "mark=\"%s\"",
+                                          (*item_function == COMMAND_PREFIX) ?
+                                          &item_function[1] : item_function);
+      xml_table_level ++;
+      xml_in_item[xml_table_level] = 0;
       if (!docbook)
         {
-          xml_insert_element (ITEMIZE, START);
-          xml_table_level ++;
-          xml_in_item[xml_table_level] = 0;
           xml_insert_element (ITEMFUNCTION, START);
           if (*item_function == COMMAND_PREFIX
               && item_function[strlen (item_function) - 1] != '}'
@@ -1437,15 +1443,6 @@ xml_begin_table (int type, char *item_fu
           else
             execute_string ("%s", item_function);
           xml_insert_element (ITEMFUNCTION, END);
-        }
-      else
-        {
-          xml_insert_element_with_attribute (ITEMIZE, START,
-                                             "mark=\"%s\"",
-                                             (*item_function == 
COMMAND_PREFIX) ?
-                                             &item_function[1] : 
item_function);
-          xml_table_level ++;
-          xml_in_item[xml_table_level] = 0;
         }
       break;
     }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]