texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/makeinfo multi.c,1.2,1.3 xml.c,1.10,1.11


From: dirt
Subject: texinfo/makeinfo multi.c,1.2,1.3 xml.c,1.10,1.11
Date: Tue, 30 Dec 2003 15:22:32 +0100

Update of /cvsroot/texinfo/texinfo/makeinfo
In directory sheep:/tmp/cvs-serv5402/makeinfo

Modified Files:
        multi.c xml.c 
Log Message:
2003-12-30  Alper Ersoy  <address@hidden>

        * makeinfo/multi.c (multitable_item): removed thead and tbody from
        HTML tables.  Added hsep after @headitem for Info.
        (multitable_item, multitable_tab): for HTML, use th instead of td for
        @headitem rows.

        * makeinfo/xml.c (xml_begin_multitable): moved Docbook TGROUP code to
        a ...
        (xml_begin_multitable_group): new function.
        (xml_end_multitable_row): restart TGROUP on @headitem.
        (xml_end_multitable): warn if @headitem is the last item in
        multitable, and output format is Docbook.  Joined common code between
        XML and Docbook.



Index: multi.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/multi.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** multi.c     2003/12/28 11:48:52     1.2
--- multi.c     2003/12/30 14:22:30     1.3
***************
*** 410,413 ****
--- 410,414 ----
  
  int after_headitem = 0;
+ int headitem_row = 0;
  
  /* start a new item (row) of a multitable */
***************
*** 420,426 ****
    }
  
-   if (!first_row && headitem_flag)
-     line_error (_("%cheaditem can only be used as the first item"), 
COMMAND_PREFIX);
- 
    current_column_no = 1;
  
--- 421,424 ----
***************
*** 428,445 ****
      {
        if (!first_row)
!       add_word ("<br></td></tr>");    /* <br> for non-tables browsers. */
! 
!       if (headitem_flag)
!         add_word ("<thead>\n");
!       else if (after_headitem)
!         add_word ("\n</thead><tbody>\n");
!       else if (first_row)
!         add_word ("<tbody>\n");
  
        if (seen_column_fractions)
!         add_word_args ("<tr align=\"left\"><td valign=\"top\" 
width=\"%d%%\">",
              envs[current_column_no].fill_column);
        else
!         add_word ("<tr align=\"left\"><td valign=\"top\">");
  
        if (headitem_flag)
--- 426,439 ----
      {
        if (!first_row)
!         /* <br> for non-tables browsers. */
!       add_word_args ("<br></%s></tr>", after_headitem ? "th" : "td");
  
        if (seen_column_fractions)
!         add_word_args ("<tr align=\"left\"><%s valign=\"top\" 
width=\"%d%%\">",
!             headitem_flag ? "th" : "td",
              envs[current_column_no].fill_column);
        else
!         add_word_args ("<tr align=\"left\"><%s valign=\"top\">",
!             headitem_flag ? "th" : "td");
  
        if (headitem_flag)
***************
*** 448,451 ****
--- 442,446 ----
          after_headitem = 0;
        first_row = 0;
+       headitem_row = headitem_flag;
        headitem_flag = 0;
        return 0;
***************
*** 479,482 ****
--- 474,480 ----
  
    if (headitem_flag)
+     hsep++;
+ 
+   if (headitem_flag)
      after_headitem = 1;
    else
***************
*** 588,595 ****
      {
        if (seen_column_fractions)
!         add_word_args ("</td><td valign=\"top\" width=\"%d%%\">",
              envs[current_column_no].fill_column);
        else
!         add_word ("</td><td valign=\"top\">");
      }
    /*  else if (docbook)*/ /* 05-08 */
--- 586,597 ----
      {
        if (seen_column_fractions)
!         add_word_args ("</%s><%s valign=\"top\" width=\"%d%%\">",
!             headitem_row ? "th" : "td",
!             headitem_row ? "th" : "td",
              envs[current_column_no].fill_column);
        else
!         add_word_args ("</%s><%s valign=\"top\">",
!             headitem_row ? "th" : "td",
!             headitem_row ? "th" : "td");
      }
    /*  else if (docbook)*/ /* 05-08 */
***************
*** 619,623 ****
  
    if (html)
!     add_word ("<br></td></tr></tbody></table>\n");
    /*  else if (docbook)*/ /* 05-08 */
    else if (xml)
--- 621,625 ----
  
    if (html)
!     add_word_args ("<br></%s></tr></table>\n", headitem_row ? "th" : "td");
    /*  else if (docbook)*/ /* 05-08 */
    else if (xml)

Index: xml.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/xml.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** xml.c       2003/12/30 11:15:23     1.10
--- xml.c       2003/12/30 14:22:30     1.11
***************
*** 1900,1903 ****
--- 1900,1907 ----
   * MULTITABLE
   */
+ 
+ static int multitable_columns_count;
+ static int *multitable_column_widths;
+ 
  void
  xml_begin_multitable (ncolumns, column_widths)
***************
*** 1913,1922 ****
          xml_insert_element (MULTITABLE, START);
  
!       xml_insert_element_with_attribute (TGROUP, START, "cols=\"%d\"", 
ncolumns);
!       for (i=0; i<ncolumns; i++)
!         {
!           xml_insert_element_with_attribute (COLSPEC, START, 
"colwidth=\"%d*\"", column_widths[i]);
!           xml_insert_element (COLSPEC, END);
!         }
        xml_no_para = 1;
      }
--- 1917,1925 ----
          xml_insert_element (MULTITABLE, START);
  
!       multitable_columns_count = ncolumns;
!       multitable_column_widths = xmalloc (sizeof (int) * ncolumns);
!       memcpy (multitable_column_widths, column_widths,
!           sizeof (int) * ncolumns);
! 
        xml_no_para = 1;
      }
***************
*** 1935,1938 ****
--- 1938,1957 ----
  
  void
+ xml_begin_multitable_group ()
+ {
+   int i;
+ 
+   xml_insert_element_with_attribute (TGROUP, START, "cols=\"%d\"",
+       multitable_columns_count);
+ 
+   for (i=0; i < multitable_columns_count; i++)
+     {
+       xml_insert_element_with_attribute (COLSPEC, START,
+           "colwidth=\"%d*\"", multitable_column_widths[i]);
+       xml_insert_element (COLSPEC, END);
+     }
+ }
+ 
+ void
  xml_end_multitable_row (first_row)
      int first_row;
***************
*** 1945,1949 ****
  
    if (headitem_flag)
!     xml_insert_element (THEAD, START);
    else if (after_headitem)
      {
--- 1964,1985 ----
  
    if (headitem_flag)
!     {
!       if (!first_row)
!         {
!           if (after_headitem)
!             xml_insert_element (THEAD, END);
!           else
!             xml_insert_element (TBODY, END);
!           xml_insert_element (TGROUP, END);
!         }
! 
!       xml_begin_multitable_group ();
!       xml_insert_element (THEAD, START);
!     }
!   else if (first_row)
!     {
!       xml_begin_multitable_group ();
!       xml_insert_element (TBODY, START);
!     }
    else if (after_headitem)
      {
***************
*** 1968,1988 ****
  xml_end_multitable ()
  {
!   if (docbook)
      {
!       xml_insert_element (ENTRY, END);
!       xml_insert_element (ROW, END);
!       xml_insert_element (TBODY, END);
!       xml_insert_element (TGROUP, END);
!       xml_insert_element (MULTITABLE, END);
!       xml_no_para = 0;
      }
    else
!     {
!       xml_insert_element (ENTRY, END);
!       xml_insert_element (ROW, END);
!       xml_insert_element (TBODY, END);
!       xml_insert_element (MULTITABLE, END);
!       xml_no_para = 0;
!     }
  }
  
--- 2004,2024 ----
  xml_end_multitable ()
  {
!   xml_insert_element (ENTRY, END);
!   xml_insert_element (ROW, END);
! 
!   if (after_headitem)
      {
!       if (docbook)
!         warning (_("@headitem as the last item of @multitable produces 
invalid Docbook documents"));
!       xml_insert_element (THEAD, END);
      }
    else
!     xml_insert_element (TBODY, END);
! 
!   if (docbook)
!     xml_insert_element (TGROUP, END);
! 
!   xml_insert_element (MULTITABLE, END);
!   xml_no_para = 0;
  }
  



reply via email to

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