diff options
author | Ali Abdin <aliabdin@aucegypt.edu> | 2000-08-12 00:17:07 +0000 |
---|---|---|
committer | Ali Abdin <rakholh@src.gnome.org> | 2000-08-12 00:17:07 +0000 |
commit | cbeba404846f0a93479ae3d872ae18a1a22217a5 (patch) | |
tree | 59ee802f3f0863d2d677469a6ea7c9f8c1b19780 /components | |
parent | c66553485082e59edc36d6fa95251c8687829f9c (diff) | |
download | nautilus-cbeba404846f0a93479ae3d872ae18a1a22217a5.tar.gz |
Added an ASSUMPTIONS (it might be temporary) and elborated on a TODO item.
2000-08-11 Ali Abdin <aliabdin@aucegypt.edu>
* components/help/converters/gnome-db2html2/ASSUMPTIONS:
* components/help/converters/gnome-db2html2/TODO:
Added an ASSUMPTIONS (it might be temporary) and elborated on a TODO
item.
* components/help/converters/gnome-db2html2/sect-preparse.c:
(sect_preparse_figure_start_element) Keep a hash of the figure_id's
encountered.
* components/help/converters/gnome-db2html2/gdb3html.h:
Add a hash table to the Context struct
* components/help/converters/sect-elements.c:
(sect_xref_start_element):
Special case handling of xref's to images.
Diffstat (limited to 'components')
6 files changed, 57 insertions, 8 deletions
diff --git a/components/help/converters/gnome-db2html2/ASSUMPTIONS b/components/help/converters/gnome-db2html2/ASSUMPTIONS index 92e4bb6f1..65d682abf 100644 --- a/components/help/converters/gnome-db2html2/ASSUMPTIONS +++ b/components/help/converters/gnome-db2html2/ASSUMPTIONS @@ -44,3 +44,6 @@ each listitem has one para --------------------------------------------- each formalpara has one para --------------------------------------------- +Do not do <entry></entry> - do <entry> </entry> this makes it look much +better +--------------------------------------------- diff --git a/components/help/converters/gnome-db2html2/TODO b/components/help/converters/gnome-db2html2/TODO index b8522efb3..10831c987 100644 --- a/components/help/converters/gnome-db2html2/TODO +++ b/components/help/converters/gnome-db2html2/TODO @@ -2,7 +2,10 @@ List of things I know I need to do: ----------------------------------- Store the id of the sect with the title of the graphic so that I can get -xref correctly. +xref correctly - (Ali: I looked at this item and there seems no point in doing +this. We can only examine graphics in the /CURRENT/ sect-id (the one specified +on the command-line) using the pre-parser. This means we cannot properly xref +figure's outside the current sect) Store sect level so we can do <H2>/<H3> correctly for section headers - This appears to be done (if this is meant for the table of contents) diff --git a/components/help/converters/gnome-db2html2/gdb3html.c b/components/help/converters/gnome-db2html2/gdb3html.c index a600b7e14..1147bf3f7 100644 --- a/components/help/converters/gnome-db2html2/gdb3html.c +++ b/components/help/converters/gnome-db2html2/gdb3html.c @@ -182,7 +182,6 @@ start_document (Context *context) static void end_document (Context *context) { - } static void diff --git a/components/help/converters/gnome-db2html2/gdb3html.h b/components/help/converters/gnome-db2html2/gdb3html.h index da82ed43c..46412874c 100644 --- a/components/help/converters/gnome-db2html2/gdb3html.h +++ b/components/help/converters/gnome-db2html2/gdb3html.h @@ -123,6 +123,7 @@ struct _Context { gchar *target_section; GList *stack; gpointer data; + GHashTable *figure_data; /* determine the "depth" that the current section is on. * only applies to section */ diff --git a/components/help/converters/gnome-db2html2/sect-elements.c b/components/help/converters/gnome-db2html2/sect-elements.c index 9e837040a..75ba3d769 100644 --- a/components/help/converters/gnome-db2html2/sect-elements.c +++ b/components/help/converters/gnome-db2html2/sect-elements.c @@ -822,12 +822,25 @@ sect_xref_start_element (Context *context, { gchar **atrs_ptr; gchar *title = NULL; + gchar *fignum_from_figure_id = NULL; if (!IS_IN_SECT (context)) return; + - sect_print (context, "<A HREF=\"help:%s", context->base_file); atrs_ptr = (gchar **) atrs; + if (*atrs_ptr) { + atrs_ptr++; + fignum_from_figure_id = g_hash_table_lookup (context->figure_data, *atrs_ptr); + atrs_ptr--; + } + + if (fignum_from_figure_id != NULL) { + sect_print (context, "Figure %s", fignum_from_figure_id); + return; + } + + sect_print (context, "<A HREF=\"help:%s", context->base_file); while (atrs_ptr && *atrs_ptr) { if (!g_strcasecmp (*atrs_ptr, "linkend")) { atrs_ptr++; @@ -840,10 +853,11 @@ sect_xref_start_element (Context *context, if (*atrs_ptr) title = g_hash_table_lookup (((SectContext *)context->data)->title_hash, *atrs_ptr); - if (title == NULL) - sect_print (context, "\">the section here</A>"); - else - sect_print (context, "\">the section <EM>%s</EM></A>", title); + if (title == NULL) { + sect_print (context, "\">the section here</A>"); + } else { + sect_print (context, "\">the section <EM>%s</EM></A>", title); + } } void diff --git a/components/help/converters/gnome-db2html2/sect-preparse.c b/components/help/converters/gnome-db2html2/sect-preparse.c index 33c8d9133..92fc32b0f 100644 --- a/components/help/converters/gnome-db2html2/sect-preparse.c +++ b/components/help/converters/gnome-db2html2/sect-preparse.c @@ -6,6 +6,7 @@ static void sect_preparse_sect_start_element (Context *context, const gchar *name, const xmlChar **atrs); static void sect_preparse_title_characters (Context *context, const gchar *chars, gint len); +static void sect_preparse_figure_start_element (Context *context, const char *name, const xmlChar **atrs); ElementInfo sect_preparse[] = { { ARTICLE, "article", NULL, NULL, NULL}, @@ -39,7 +40,7 @@ ElementInfo sect_preparse[] = { { ULINK, "ulink", NULL, NULL, NULL}, { XREF, "xref", NULL, NULL, NULL}, { FOOTNOTE, "footnote", NULL, NULL, NULL}, - { FIGURE, "figure", NULL, NULL, NULL}, + { FIGURE, "figure", (startElementSAXFunc) sect_preparse_figure_start_element, NULL, NULL}, { GRAPHIC, "graphic", NULL, NULL, NULL}, { CITETITLE, "citetitle", NULL, NULL, NULL}, { APPLICATION, "application", NULL, NULL, NULL}, @@ -143,3 +144,31 @@ sect_preparse_title_characters (Context *context, atrs_ptr += 2; } } + +static void +sect_preparse_figure_start_element (Context *context, + const char *name, + const xmlChar **atrs) +{ + gchar **atrs_ptr; + static gint figure_num = 0; + + + figure_num++; + atrs_ptr = (gchar **) atrs; + while (atrs_ptr && *atrs_ptr) { + if (g_strcasecmp (*atrs_ptr, "id") == 0) { + atrs_ptr++; + if (context->figure_data == NULL) { + context->figure_data = g_hash_table_new (g_str_hash, g_str_equal); + } + if (g_hash_table_lookup (context->figure_data, *atrs_ptr) == NULL) { + /* The key is the 'figure id' - The data is the 'sect id' */ + g_hash_table_insert (context->figure_data, g_strdup (*atrs_ptr), g_strdup_printf("%d",figure_num)); + } + break; + } + atrs_ptr += 2; + } + +} |