texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/makeinfo cmds.c,1.4,1.5 xml.c,1.6,1.7 xml.h,1.3,1.4 texinfo.dtd,


From: dirt
Subject: texinfo/makeinfo cmds.c,1.4,1.5 xml.c,1.6,1.7 xml.h,1.3,1.4 texinfo.dtd,1.3,1.4
Date: Fri, 19 Dec 2003 16:48:34 +0100

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

Modified Files:
        cmds.c xml.c xml.h texinfo.dtd 
Log Message:
2003-12-19  Alper Ersoy  <address@hidden>

        * makeinfo/cmds.c (cm_acronym): read and make use of second argument
        like texinfo.tex does.

        * makeinfo/xml.c:
        * makeinfo/xml.h:
        * makeinfo/texinfo.dtd: new elements acronymword and acronymdesc.



Index: cmds.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/cmds.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** cmds.c      2003/12/18 01:39:24     1.4
--- cmds.c      2003/12/19 15:48:32     1.5
***************
*** 667,674 ****
       int arg;
  {
    if (html)
!     insert_html_tag (arg, "acronym");
    else if (xml)
!     xml_insert_element (ACRONYM, arg);
  }
  
--- 667,744 ----
       int arg;
  {
+   char *acronym, *description;
+ 
+   /* We do everything at START.  */
+   if (arg == END)
+     return;
+ 
+   get_until_in_braces (",", &acronym);
+   if (input_text[input_text_offset] == ',')
+     input_text_offset++;
+   get_until_in_braces ("}", &description);
+ 
+   canon_white (acronym);
+   canon_white (description);
+ 
+   /* If not enclosed in braces, strip after comma to be compatible
+      with texinfo.tex.  */
+   if (description[0] != '{' && index (description, ',') != NULL)
+     {
+       int i = 0;
+       while (description[i] != ',')
+         i++;
+       /* For now, just terminate the string at comma.  */
+       description[i] = '\0';
+     }
+ 
+   /* Get description out of braces.  */
+   if (description[0] == '{')
+     description++;
+   if (description[strlen (description)-1] == '}')
+     description[strlen (description)-1] = '\0';
+ 
    if (html)
!     {
!       add_word ("<acronym");
! 
!       if (strlen (description) > 0)
!         add_word_args (" title=\"%s\"", text_expansion (description));
!       else
!         printf ("FIXME: should get title from previous acronyms, if 
possible.\n");
! 
!       add_char ('>');
!       execute_string ("%s", acronym);
!       add_word ("</acronym>");
!     }
!   else if (docbook)
!     {
!       xml_insert_element (ACRONYM, START);
!       execute_string ("%s", acronym);
!       xml_insert_element (ACRONYM, END);
!     }
    else if (xml)
!     {
!       xml_insert_element (ACRONYM, START);
! 
!       xml_insert_element (ACRONYMWORD, START);
!       execute_string ("%s", acronym);
!       xml_insert_element (ACRONYMWORD, END);
! 
!       if (strlen (description) > 0)
!         {
!           xml_insert_element (ACRONYMDESC, START);
!           execute_string ("%s", description);
!           xml_insert_element (ACRONYMDESC, END);
!         }
! 
!       xml_insert_element (ACRONYM, END);
!     }
!   else
!     execute_string ("%s", acronym);
! 
!   /* Put description into parenthesis after the acronym for all outputs
!      except XML.  */
!   if (strlen (description) > 0 && (!xml || docbook))
!     add_word_args (" (%s)", description);
  }
  

Index: xml.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/xml.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** xml.c       2003/12/16 21:29:40     1.6
--- xml.c       2003/12/19 15:48:32     1.7
***************
*** 90,93 ****
--- 90,96 ----
  
    { "acronym",             0, 1, 0 },
+   { "acronymword",         0, 1, 0 },
+   { "acronymdesc",         0, 1, 0 },
+ 
    { "tt",                  0, 1, 0 },
    { "code",                0, 1, 0 },
***************
*** 285,288 ****
--- 288,294 ----
  
    { "acronym",             0, 1, 0 },
+   { "",                    0, 1, 0 }, /* ACRONYMWORD */
+   { "",                    0, 1, 0 }, /* ACRONYMDESC */
+ 
    { "literal",             0, 1, 0 }, /* TT */
    { "literal",             0, 1, 0 }, /* CODE */

Index: xml.h
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/xml.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** xml.h       2003/12/13 11:29:50     1.3
--- xml.h       2003/12/19 15:48:32     1.4
***************
*** 57,63 ****
    MENU /* 30 */, MENUENTRY, MENUTITLE, MENUCOMMENT, MENUNODE, NODENAME,
    /* -- */
!   ACRONYM/* 36 */, TT, CODE, COMMAND_TAG, ENV, FILE_TAG, OPTION, SAMP,
!     KBD, URL, KEY, VAR, SC, DFN, EMPH, STRONG,
!     CITE, NOTFIXEDWIDTH, I, B, R,  
    TITLE, 
    IFINFO, 
--- 57,63 ----
    MENU /* 30 */, MENUENTRY, MENUTITLE, MENUCOMMENT, MENUNODE, NODENAME,
    /* -- */
!   ACRONYM/* 36 */, ACRONYMWORD, ACRONYMDESC,
!   TT, CODE, COMMAND_TAG, ENV, FILE_TAG, OPTION, SAMP, KBD, URL, KEY,
!   VAR, SC, DFN, EMPH, STRONG, CITE, NOTFIXEDWIDTH, I, B, R,  
    TITLE, 
    IFINFO, 

Index: texinfo.dtd
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/texinfo.dtd,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** texinfo.dtd 2003/12/13 11:38:57     1.3
--- texinfo.dtd 2003/12/19 15:48:32     1.4
***************
*** 294,299 ****
  <!ELEMENT kbd     (#PCDATA | %Inline.phrase;)*>
  <!ELEMENT var     (#PCDATA | %Inline.phrase;)*>
- <!ELEMENT acronym (#PCDATA | %Inline.phrase;)*>
  <!ELEMENT url     (#PCDATA | %Inline.phrase;)*>
  
  <!-- reference -->
--- 294,302 ----
  <!ELEMENT kbd     (#PCDATA | %Inline.phrase;)*>
  <!ELEMENT var     (#PCDATA | %Inline.phrase;)*>
  <!ELEMENT url     (#PCDATA | %Inline.phrase;)*>
+ 
+ <!ELEMENT acronym (acronymword, acronymdesc?)>
+ <!ELEMENT acronymword (#PCDATA | %Inline.phrase;)*>
+ <!ELEMENT acronymdesc (#PCDATA | %Inline.phrase;)*>
  
  <!-- reference -->



reply via email to

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