[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/makeinfo cmds.c,1.23,1.24 html.c,1.10,1.11 insertion.c,1.14,1.15
From: |
dirt |
Subject: |
texinfo/makeinfo cmds.c,1.23,1.24 html.c,1.10,1.11 insertion.c,1.14,1.15 lang.c,1.4,1.5 makeinfo.c,1.32,1.33 sectioning.c,1.6,1.7 xml.c,1.17,1.18 xml.h,1.8,1.9 |
Date: |
Sun, 25 Jan 2004 15:26:51 +0100 |
Update of /cvsroot/texinfo/texinfo/makeinfo
In directory sheep:/tmp/cvs-serv29714/makeinfo
Modified Files:
cmds.c html.c insertion.c lang.c makeinfo.c sectioning.c xml.c
xml.h
Log Message:
2004-01-25 Alper Ersoy <address@hidden>
* makeinfo/xml.c:
* makeinfo/xml.h: new element EXDENT.
* makeinfo/cmds.c (cm_comment): save the paragraph state.
(cm_exdent): use EXDENT element for XML, LINEANNOTATION for Docbook.
* makeinfo/html.c (html_output_head):
* makeinfo/xml.c (xml_begin_document): erase output_paragraph.
* makeinfo/insertion.c (begin_insertion): canonize whitespace around
copying text.
(cm_insert_copying): comment fixes. Do not append newline if the
output is Docbook.
* makeinfo/makeinfo.c (close_paragraph): return if Docbook too.
* makeinfo/sectioning.c (sectioning_underscore): removed newline from
the end of titles.
* makeinfo/lang.c (cm_documentencoding): insert encoding attribute
into XML and Docbook prologs when handling delayed writes.
* makeinfo/xml.c (xml_begin_document): register a delayed write for
@documentencoding when writing the prolog.
(xml_end_para): removed docbook checks.
(xml_insert_element_with_attribute): skip indentation if
xml_keep_space is true, indent after table element. When the output
is Docbook, do not insert xml:space attribute, and do not remove from
the end of group element and keep_space blocks.
(xml_add_char): join lines in a paragraph for Docbook too.
Index: cmds.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/cmds.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** cmds.c 24 Jan 2004 15:58:10 -0000 1.23
--- cmds.c 25 Jan 2004 14:26:48 -0000 1.24
***************
*** 635,651 ****
{
int save_inhibit_indentation = inhibit_paragraph_indentation;
int save_escape_html = escape_html;
int save_xml_no_para = xml_no_para;
! int i, just_after_dash = 0;
inhibit_paragraph_indentation = 1;
escape_html = 0;
xml_no_para = 1;
/* @c and @comment can appear between @item and @itemx,
@deffn and @deffnx. */
xml_dont_touch_items_defs++;
! if (output_paragraph[output_paragraph_offset-1] != '\n'
! && (!xml || xml_indentation_increment > 0))
insert ('\n');
--- 635,655 ----
{
int save_inhibit_indentation = inhibit_paragraph_indentation;
+ int save_paragraph_is_open = paragraph_is_open;
int save_escape_html = escape_html;
int save_xml_no_para = xml_no_para;
! int i;
inhibit_paragraph_indentation = 1;
escape_html = 0;
xml_no_para = 1;
+
/* @c and @comment can appear between @item and @itemx,
@deffn and @deffnx. */
xml_dont_touch_items_defs++;
! /* Use insert for HTML, and XML when indentation is enabled.
! For Docbook, use add_char. */
! if (xml && xml_indentation_increment > 0
! && output_paragraph[output_paragraph_offset-1] != '\n')
insert ('\n');
***************
*** 653,668 ****
add_html_block_elt ("<!-- ");
for (i = 0; i < strlen (line); i++)
! {
! if (line[i] != '-' || !just_after_dash)
! add_char (line[i]);
!
! if (line[i] == '-')
! just_after_dash = 1;
! else
! just_after_dash = 0;
! }
add_word (" -->");
inhibit_paragraph_indentation = save_inhibit_indentation;
escape_html = save_escape_html;
xml_no_para = save_xml_no_para;
--- 657,669 ----
add_html_block_elt ("<!-- ");
for (i = 0; i < strlen (line); i++)
! if (line[i] != '-' || (i && line[i-1] != '-'))
! add_char (line[i]);
add_word (" -->");
+ if (html)
+ add_char ('\n');
+
inhibit_paragraph_indentation = save_inhibit_indentation;
+ paragraph_is_open = save_paragraph_is_open;
escape_html = save_escape_html;
xml_no_para = save_xml_no_para;
***************
*** 1577,1580 ****
--- 1578,1585 ----
if (html)
add_word ("<br>");
+ else if (docbook)
+ xml_insert_element (LINEANNOTATION, START);
+ else if (xml)
+ xml_insert_element (EXDENT, START);
/* Can't close_single_paragraph, then we lose preceding blank lines. */
***************
*** 1585,1593 ****
if (html)
add_word ("<br>");
close_single_paragraph ();
current_indent = save_indent;
in_fixed_width_font = save_in_fixed_width_font;
! start_paragraph ();
}
--- 1590,1605 ----
if (html)
add_word ("<br>");
+ else if (xml)
+ {
+ xml_insert_element (docbook ? LINEANNOTATION : EXDENT, END);
+ insert ('\n');
+ }
+
close_single_paragraph ();
current_indent = save_indent;
in_fixed_width_font = save_in_fixed_width_font;
! if (!xml)
! start_paragraph ();
}
Index: html.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/html.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** html.c 17 Jan 2004 11:03:54 -0000 1.10
--- html.c 25 Jan 2004 14:26:48 -0000 1.11
***************
*** 49,52 ****
--- 49,55 ----
html_title = escape_string (title ? text_expansion (title) :
_("Untitled"));
+ /* Make sure this is the very first string of the output document. */
+ output_paragraph_offset = 0;
+
add_html_block_elt_args ("<html lang=\"%s\">\n<head>\n",
language_table[language_code].abbrev);
Index: insertion.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/insertion.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** insertion.c 24 Jan 2004 15:58:10 -0000 1.14
--- insertion.c 25 Jan 2004 14:26:48 -0000 1.15
***************
*** 537,540 ****
--- 537,541 ----
}
copying_text = full_expansion (text, 0);
+ canon_white (copying_text);
free (text);
***************
*** 1426,1435 ****
xml_end_para ();
- /* insert_string rather than add_word because we've already done
- full expansion on copying_text when we saved it. */
-
if (docbook && xml_in_bookinfo)
{ /* Remove blockquote if we are inside bookinfo, because we have
! legalnotice there so quotation is unnecessary. */
char *temp;
int start_pos = 0;
--- 1427,1433 ----
xml_end_para ();
if (docbook && xml_in_bookinfo)
{ /* Remove blockquote if we are inside bookinfo, because we have
! legalnotice there, so quotation is unnecessary. */
char *temp;
int start_pos = 0;
***************
*** 1452,1455 ****
--- 1450,1455 ----
temp[len - start_pos - end_pos] = '\0';
+ /* insert_string rather than add_word because we've already
+ done full expansion on copying_text when we saved it. */
insert_string (temp);
***************
*** 1459,1463 ****
insert_string (copying_text);
! if (!xml || docbook)
insert ('\n');
--- 1459,1463 ----
insert_string (copying_text);
! if (!xml)
insert ('\n');
Index: lang.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/lang.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** lang.c 25 Dec 2003 09:53:48 -0000 1.4
--- lang.c 25 Jan 2004 14:26:48 -0000 1.5
***************
*** 22,25 ****
--- 22,26 ----
#include "system.h"
#include "cmds.h"
+ #include "files.h"
#include "lang.h"
#include "makeinfo.h"
***************
*** 497,537 ****
cm_documentencoding ()
{
! encoding_code_type enc;
! char *enc_arg;
! /* This is ugly and probably needs to apply to other commands'
! argument parsing as well. When we're doing @documentencoding,
! we're generally in the frontmatter of the document, and so the.
! expansion in html/xml/docbook would generally be the empty string.
! (Because those modes wait until the first normal text of the
! document to start outputting.) The result would thus be a warning
! "unrecognized encoding name `'". Sigh. */
! int save_html = html;
! int save_xml = xml;
! html = 0;
! xml = 0;
! get_rest_of_line (1, &enc_arg);
! html = save_html;
! xml = save_xml;
! /* See if we have this encoding. */
! for (enc = no_encoding+1; enc != last_encoding_code; enc++)
! {
! if (strcasecmp (enc_arg, encoding_table[enc].encname) == 0)
{
! document_encoding_code = enc;
! break;
}
- }
! /* If we didn't find this code, complain. */
! if (enc == last_encoding_code)
! warning (_("unrecognized encoding name `%s'"), enc_arg);
! else if (encoding_table[document_encoding_code].isotab == NULL)
! warning (_("sorry, encoding `%s' not supported"), enc_arg);
! free (enc_arg);
}
--- 498,547 ----
cm_documentencoding ()
{
! if (!handling_delayed_writes)
! {
! encoding_code_type enc;
! char *enc_arg;
! /* This is ugly and probably needs to apply to other commands'
! argument parsing as well. When we're doing @documentencoding,
! we're generally in the frontmatter of the document, and so the.
! expansion in html/xml/docbook would generally be the empty string.
! (Because those modes wait until the first normal text of the
! document to start outputting.) The result would thus be a warning
! "unrecognized encoding name `'". Sigh. */
! int save_html = html;
! int save_xml = xml;
! html = 0;
! xml = 0;
! get_rest_of_line (1, &enc_arg);
! html = save_html;
! xml = save_xml;
! /* See if we have this encoding. */
! for (enc = no_encoding+1; enc != last_encoding_code; enc++)
{
! if (strcasecmp (enc_arg, encoding_table[enc].encname) == 0)
! {
! document_encoding_code = enc;
! break;
! }
}
! /* If we didn't find this code, complain. */
! if (enc == last_encoding_code)
! warning (_("unrecognized encoding name `%s'"), enc_arg);
! else if (encoding_table[document_encoding_code].isotab == NULL)
! warning (_("sorry, encoding `%s' not supported"), enc_arg);
! free (enc_arg);
! }
! else if (xml && document_encoding_code != no_encoding)
! {
! insert_string (" encoding=\"");
! insert_string (current_document_encoding ());
! insert_string ("\"");
! }
}
Index: makeinfo.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/makeinfo.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** makeinfo.c 24 Jan 2004 15:58:10 -0000 1.32
--- makeinfo.c 25 Jan 2004 14:26:48 -0000 1.33
***************
*** 3021,3025 ****
int i;
! if (xml && !docbook)
return;
--- 3021,3027 ----
int i;
! /* We don't need these newlines in XML and Docbook outputs for
! paragraph seperation. We have <para> element for that. */
! if (xml)
return;
Index: sectioning.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/sectioning.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sectioning.c 6 Jan 2004 18:42:10 -0000 1.6
--- sectioning.c 25 Jan 2004 14:26:48 -0000 1.7
***************
*** 373,377 ****
if (STREQ (command, "top") && strlen(temp) == 0)
temp = xstrdup (title);
! execute_string ("%s\n", temp);
/* Keep track of @unnumbered sections for proper @xrefs. */
--- 373,377 ----
if (STREQ (command, "top") && strlen(temp) == 0)
temp = xstrdup (title);
! execute_string ("%s", temp);
/* Keep track of @unnumbered sections for proper @xrefs. */
Index: xml.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/xml.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** xml.c 24 Jan 2004 15:58:10 -0000 1.17
--- xml.c 25 Jan 2004 14:26:48 -0000 1.18
***************
*** 116,119 ****
--- 116,121 ----
{ "r", 0, 1, 0 },
+ { "exdent", 0, 0, 0 },
+
{ "title", 0, 0, 0 },
{ "ifinfo", 1, 0, 0 },
***************
*** 319,322 ****
--- 321,326 ----
{ "", 0, 1, 0 }, /* R */
+ { "", 0, 0, 0 }, /* EXDENT */
+
{ "title", 0, 0, 0 },
{ "", 1, 0, 0 }, /* IFINFO */
***************
*** 325,339 ****
{ "", 0, 0, 0 }, /* DIRCATEGORY */
{ "blockquote", 1, 0, 0 }, /* QUOTATION */
! { "screen", 0, 0, 0 },
! { "screen", 0, 0, 0 }, /* SMALLEXAMPLE */
! { "programlisting", 0, 0, 0 }, /* LISP */
! { "programlisting", 0, 0, 0 }, /* SMALLLISP */
{ "", 1, 0, 0 }, /* CARTOUCHE */
{ "", 1, 0, 0 }, /* COPYING */
! { "screen", 0, 1, 0 }, /* FORMAT */
! { "screen", 0, 1, 0 }, /* SMALLFORMAT */
! { "literallayout", 0, 1, 0 }, /* DISPLAY */
! { "literallayout", 0, 1, 0 }, /* SMALLDISPLAY */
! { "screen", 0, 0, 0 }, /* VERBATIM */
{ "footnote", 0, 1, 0 },
{ "lineannotation", 0, 1, 0 },
--- 329,343 ----
{ "", 0, 0, 0 }, /* DIRCATEGORY */
{ "blockquote", 1, 0, 0 }, /* QUOTATION */
! { "screen", 0, 0, 1 }, /* EXAMPLE */
! { "screen", 0, 0, 1 }, /* SMALLEXAMPLE */
! { "programlisting", 0, 0, 1 }, /* LISP */
! { "programlisting", 0, 0, 1 }, /* SMALLLISP */
{ "", 1, 0, 0 }, /* CARTOUCHE */
{ "", 1, 0, 0 }, /* COPYING */
! { "screen", 0, 1, 1 }, /* FORMAT */
! { "screen", 0, 1, 1 }, /* SMALLFORMAT */
! { "literallayout", 0, 1, 1 }, /* DISPLAY */
! { "literallayout", 0, 1, 1 }, /* SMALLDISPLAY */
! { "screen", 0, 0, 1 }, /* VERBATIM */
{ "footnote", 0, 1, 0 },
{ "lineannotation", 0, 1, 0 },
***************
*** 594,604 ****
book_started = 1;
insert_string ("<?xml version=\"1.0\"");
! if (document_encoding_code != no_encoding)
! {
! insert_string (" encoding=\"");
! insert_string (current_document_encoding ());
! insert_string ("\"");
! }
insert_string ("?>");
--- 598,608 ----
book_started = 1;
+ /* Make sure this is the very first string of the output document. */
+ output_paragraph_offset = 0;
+
insert_string ("<?xml version=\"1.0\"");
! /* At this point, we register a delayed writing for document encoding,
! so in the end, proper encoding attribute will be inserted here. */
! register_delayed_write ("@documentencoding");
insert_string ("?>");
***************
*** 723,729 ****
return;
! if (docbook && output_paragraph[output_paragraph_offset-1] == '\n')
! xml_indent_end_para ();
! if (!docbook && output_paragraph[output_paragraph_offset-1] == ' ')
output_paragraph_offset--;
--- 727,731 ----
return;
! while (cr_or_whitespace(output_paragraph[output_paragraph_offset-1]))
output_paragraph_offset--;
***************
*** 869,873 ****
}
! if (arg == START && !xml_in_para &&
!xml_element_list[elt].contained_in_para)
xml_indent ();
--- 871,876 ----
}
! if (arg == START && !xml_in_para && !xml_keep_space
! && !xml_element_list[elt].contained_in_para)
xml_indent ();
***************
*** 878,882 ****
/* Eat one newline before </example> and the like. */
! if (arg == END && (xml_element_list[elt].keep_space || elt == GROUP)
&& output_paragraph[output_paragraph_offset-1] == '\n')
output_paragraph_offset--;
--- 881,886 ----
/* Eat one newline before </example> and the like. */
! if (!docbook && arg == END
! && (xml_element_list[elt].keep_space || elt == GROUP)
&& output_paragraph[output_paragraph_offset-1] == '\n')
output_paragraph_offset--;
***************
*** 888,892 ****
/* Indent elements that can contain <para>. */
! if (arg == END && !xml_in_para && xml_element_list[elt].contains_para)
xml_indent ();
--- 892,897 ----
/* Indent elements that can contain <para>. */
! if (arg == END && !xml_in_para && !xml_keep_space
! && xml_element_list[elt].contains_para)
xml_indent ();
***************
*** 894,898 ****
directly. */
if (arg == END && (elt == MENUENTRY || elt == ITEMIZE || elt == ENUMERATE
! || elt == TABLEITEM || elt == DEFINITION || elt == DEFINITIONTERM))
xml_indent ();
--- 899,904 ----
directly. */
if (arg == END && (elt == MENUENTRY || elt == ITEMIZE || elt == ENUMERATE
! || elt == TABLEITEM || elt == TABLE
! || elt == DEFINITION || elt == DEFINITIONTERM))
xml_indent ();
***************
*** 935,939 ****
if (arg == START)
{
! insert_string (" xml:space=\"preserve\"");
xml_keep_space++;
}
--- 941,946 ----
if (arg == START)
{
! if (!docbook)
! insert_string (" xml:space=\"preserve\"");
xml_keep_space++;
}
***************
*** 1250,1255 ****
xml_end_para ();
xml_just_after_element = 1;
! if (!docbook)
! return;
}
--- 1257,1261 ----
xml_end_para ();
xml_just_after_element = 1;
! return;
}
***************
*** 1275,1279 ****
else if (character == '<' && escape_html)
insert_string ("<");
! else if (character == '\n' && !xml_keep_space && !docbook)
{
if (!xml_in_para && xml_just_after_element && !multitable_active)
--- 1281,1285 ----
else if (character == '<' && escape_html)
insert_string ("<");
! else if (character == '\n' && !xml_keep_space)
{
if (!xml_in_para && xml_just_after_element && !multitable_active)
Index: xml.h
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/xml.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** xml.h 24 Jan 2004 15:58:10 -0000 1.8
--- xml.h 25 Jan 2004 14:26:48 -0000 1.9
***************
*** 64,68 ****
ACRONYM/* 37 */, 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,
--- 64,69 ----
ACRONYM/* 37 */, ACRONYMWORD, ACRONYMDESC,
TT, CODE, COMMAND_TAG, ENV, FILE_TAG, OPTION, SAMP, KBD, URL, KEY,
! VAR, SC, DFN, EMPH, STRONG, CITE, NOTFIXEDWIDTH, I, B, R,
! EXDENT,
TITLE,
IFINFO,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/makeinfo cmds.c,1.23,1.24 html.c,1.10,1.11 insertion.c,1.14,1.15 lang.c,1.4,1.5 makeinfo.c,1.32,1.33 sectioning.c,1.6,1.7 xml.c,1.17,1.18 xml.h,1.8,1.9,
dirt <=
- Prev by Date:
texinfo/makeinfo cmds.c,1.22,1.23 insertion.c,1.13,1.14 makeinfo.c,1.31,1.32 makeinfo.h,1.3,1.4 multi.c,1.3,1.4 xml.c,1.16,1.17 xml.h,1.7,1.8
- Next by Date:
texinfo ChangeLog,1.138,1.139
- Previous by thread:
texinfo/makeinfo cmds.c,1.22,1.23 insertion.c,1.13,1.14 makeinfo.c,1.31,1.32 makeinfo.h,1.3,1.4 multi.c,1.3,1.4 xml.c,1.16,1.17 xml.h,1.7,1.8
- Next by thread:
texinfo ChangeLog,1.138,1.139
- Index(es):