[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/makeinfo index.c,1.15,1.16 index.h,1.4,1.5
From: |
dirt |
Subject: |
texinfo/makeinfo index.c,1.15,1.16 index.h,1.4,1.5 |
Date: |
Mon, 23 Feb 2004 17:48:50 +0100 |
Update of /cvsroot/texinfo/texinfo/makeinfo
In directory sheep:/tmp/cvs-serv25036/makeinfo
Modified Files:
index.c index.h
Log Message:
2004-02-23 Alper Ersoy <address@hidden>
* makeinfo/index.c (index_add_arg, cm_printindex): rewrote hyperlink
generation for HTML to avoid duplicate anchors, and to work with
splitting enabled.
Index: index.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/index.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** index.c 19 Feb 2004 15:10:40 -0000 1.15
--- index.c 23 Feb 2004 16:48:48 -0000 1.16
***************
*** 135,138 ****
--- 135,139 ----
}
+ static int index_counter = 0;
/* Add the arguments to the current index command to the index NAME.
html fixxme generate specific html anchor */
***************
*** 171,174 ****
--- 172,177 ----
INDEX_ELT *new = xmalloc (sizeof (INDEX_ELT));
+ index_counter++;
+
/* Get output line number updated before doing anything. */
if (!html && !xml)
***************
*** 195,198 ****
--- 198,212 ----
new->defining_file = xstrdup (input_filename);
the_indices[which] = new;
+
+ new->entry_number = index_counter;
+
+ if (html && splitting)
+ {
+ if (current_output_filename && *current_output_filename)
+ new->output_file = filename_part (current_output_filename);
+ else
+ new->output_file = xstrdup ("");
+ }
+
#if 0
/* The index breaks if there are colons in the entry.
***************
*** 212,215 ****
--- 226,230 ----
int removed_empty_elt = 0;
+ /* We must put the anchor outside the <dl> and <ul> blocks. */
if (rollback_empty_tag ("dl"))
removed_empty_elt = 1;
***************
*** 217,225 ****
removed_empty_elt = 2;
! add_word_args ("<a name=\"index-%s-", name);
! add_anchor_name (new->node, 0);
! add_char ('-');
! add_anchor_name (index_entry, 0);
! add_word_args ("\"></a>");
if (removed_empty_elt == 1)
--- 232,238 ----
removed_empty_elt = 2;
! add_word ("<a name=\"index-");
! add_escaped_anchor_name (index_entry);
! add_word_args ("-%d\"></a>", index_counter);
if (removed_empty_elt == 1)
***************
*** 804,812 ****
escaped_entry = escape_string (escaped_entry);
expanded_entry = expansion (escaped_entry, index->code);
! add_word_args ("\n<li><a href=\"#index-%s-", index_name);
! add_anchor_name (index->node, 0);
! add_char ('-');
! add_anchor_name (index->entry_text, 0);
! add_word_args ("\">%s</a>: ", expanded_entry);
free (escaped_entry);
free (expanded_entry);
--- 817,825 ----
escaped_entry = escape_string (escaped_entry);
expanded_entry = expansion (escaped_entry, index->code);
! add_html_block_elt_args ("\n<li><a href=\"%s#index-",
! (splitting ? index->output_file : ""), index_name);
! add_escaped_anchor_name (index->entry_text);
! add_word_args ("-%d\">%s</a>: ", index->entry_number,
! expanded_entry);
free (escaped_entry);
free (expanded_entry);
***************
*** 835,838 ****
--- 848,853 ----
index_node already includes all we need except the #. */
add_word_args ("#%s</a>", index_node);
+
+ add_html_block_elt ("</li>");
}
else if (xml && docbook)
Index: index.h
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/index.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** index.h 18 Feb 2004 02:36:27 -0000 1.4
--- index.h 23 Feb 2004 16:48:48 -0000 1.5
***************
*** 42,45 ****
--- 42,47 ----
int output_line; /* And line number where it is in the output.
*/
char *defining_file; /* Source file for defining_line. */
+ char *output_file; /* Output file for output_line. */
+ int entry_number; /* Entry number. */
} INDEX_ELT;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/makeinfo index.c,1.15,1.16 index.h,1.4,1.5,
dirt <=