diff options
author | Jonathan Blandford <jrb@redhat.com> | 2000-02-09 04:02:12 +0000 |
---|---|---|
committer | Jonathan Blandford <jrb@src.gnome.org> | 2000-02-09 04:02:12 +0000 |
commit | fede6612fadcbe323b84777221b99039980f9f88 (patch) | |
tree | fc959ad51842660a60503cafc8c3ef27950870e2 /components | |
parent | 5e59837c1658dca3faa5f08be7b52ad098aa162e (diff) | |
download | nautilus-fede6612fadcbe323b84777221b99039980f9f88.tar.gz |
started program listing. doubting SAX's strictness big time.
2000-02-08 Jonathan Blandford <jrb@redhat.com>
* gnome-db2html2/sect-elements.c: started program listing.
doubting SAX's strictness big time.
Diffstat (limited to 'components')
5 files changed, 167 insertions, 3 deletions
diff --git a/components/help/converters/ChangeLog b/components/help/converters/ChangeLog index d0e40c17d..96b4e1461 100644 --- a/components/help/converters/ChangeLog +++ b/components/help/converters/ChangeLog @@ -1,3 +1,8 @@ +2000-02-08 Jonathan Blandford <jrb@redhat.com> + + * gnome-db2html2/sect-elements.c: started program listing. + doubting SAX's strictness big time. + 2000-02-08 Elliot Lee <sopwith@redhat.com> * gnome-man2html2/gnome-man2html.c, gnome-man2html2/Makefile.am: diff --git a/components/help/converters/gnome-db2html2/gdb3html.c b/components/help/converters/gnome-db2html2/gdb3html.c index c39f6d833..32bd8c534 100644 --- a/components/help/converters/gnome-db2html2/gdb3html.c +++ b/components/help/converters/gnome-db2html2/gdb3html.c @@ -75,6 +75,36 @@ ulink_end_element (Context *context, const gchar *name) } void +html_em_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + g_print ("<EM>"); +} + +void +html_em_end_element (Context *context, + const gchar *name) +{ + g_print ("</EM>"); +} + +void +html_tt_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + g_print ("<TT>"); +} + +void +html_tt_end_element (Context *context, + const gchar *name) +{ + g_print ("</TT>"); +} + +void artheader_start_element (Context *context, const gchar *name, const xmlChar **atrs) { g_print ("<HEAD>\n"); @@ -89,12 +119,17 @@ write_characters (Context *context, GSList *list; ElementIndex index; + /* EVIL EVIL EVIL HACK UNTIL I FIGURE OUT ENTITIES */ + if (*chars == '<') { + g_print ("<"); + return; + } list = g_slist_prepend (NULL, GINT_TO_POINTER (FOOTNOTE)); index = find_first_parent (context, list); if (index == UNDEFINED) { temp = g_strndup (chars, len); - g_print ("%s\n", temp); + g_print ("%s", temp); g_free (temp); } else { GString *footnote; @@ -160,6 +195,7 @@ get_entity (Context *context, const gchar *name) #ifdef ERROR_OUTPUT g_print ("in getEntity:%s\n", name); #endif + return xmlGetPredefinedEntity (name); } diff --git a/components/help/converters/gnome-db2html2/gdb3html.h b/components/help/converters/gnome-db2html2/gdb3html.h index b174f36bc..74ca1abfa 100644 --- a/components/help/converters/gnome-db2html2/gdb3html.h +++ b/components/help/converters/gnome-db2html2/gdb3html.h @@ -37,7 +37,15 @@ typedef enum ElementIndex { FOOTNOTE, FIGURE, GRAPHIC, - UNDEFINED /* 30 */ + CITETITLE, /* 30 */ + APPLICATION, + FILENAME, + ITEMIZED_LIST, + LISTITEM, + PROGRAMLISTING, /* 35 */ + SGMLTAG, + EMPHASIS, + UNDEFINED /* 33 */ } ElementIndex; typedef struct _ElementInfo ElementInfo; @@ -96,6 +104,10 @@ typedef struct HeaderInfo { void article_start_element (Context *context, const gchar *name, const xmlChar **atrs); void article_end_element (Context *context, const gchar *name); void artheader_start_element (Context *context, const gchar *name, const xmlChar **atrs); +void html_em_start_element (Context *context, const gchar *name, const xmlChar **atrs); +void html_em_end_element (Context *context, const gchar *name); +void html_tt_start_element (Context *context, const gchar *name, const xmlChar **atrs); +void html_tt_end_element (Context *context, const gchar *name); void para_start_element (Context *context, const gchar *name, const xmlChar **atrs); void para_end_element (Context *context, const gchar *name); void ulink_start_element (Context *context, const gchar *name, const xmlChar **atrs); diff --git a/components/help/converters/gnome-db2html2/sect-elements.c b/components/help/converters/gnome-db2html2/sect-elements.c index f3fe5f3fd..78d6c7ade 100644 --- a/components/help/converters/gnome-db2html2/sect-elements.c +++ b/components/help/converters/gnome-db2html2/sect-elements.c @@ -20,6 +20,7 @@ struct _SectContext { GList *footnotes; }; + static void sect_write_characters (Context *context, const gchar *chars, int len); static void sect_sect_start_element (Context *context, const gchar *name, const xmlChar **atrs); static void sect_sect_end_element (Context *context, const gchar *name); @@ -36,7 +37,14 @@ static void sect_title_end_element (Context *context, const gchar *name); static void sect_title_characters (Context *context, const gchar *chars, int len); static void sect_ulink_start_element (Context *context, const gchar *name, const xmlChar **atrs); static void sect_ulink_end_element (Context *context, const gchar *name); +static void sect_xref_start_element (Context *context, const gchar *name, const xmlChar **atrs); static void sect_footnote_start_element (Context *context, const gchar *name, const xmlChar **atrs); +static void sect_em_start_element (Context *context, const gchar *name, const xmlChar **atrs); +static void sect_em_end_element (Context *context, const gchar *name); +static void sect_tt_start_element (Context *context, const gchar *name, const xmlChar **atrs); +static void sect_tt_end_element (Context *context, const gchar *name); +static void sect_programlisting_start_element (Context *context, const gchar *name, const xmlChar **atrs); +static void sect_programlisting_end_element (Context *context, const gchar *name); ElementInfo sect_elements[] = { { ARTICLE, "article", (startElementSAXFunc) article_start_element, (endElementSAXFunc) sect_article_end_element, NULL}, @@ -65,10 +73,18 @@ ElementInfo sect_elements[] = { { TITLE, "title", (startElementSAXFunc) sect_title_start_element, (endElementSAXFunc) sect_title_end_element, (charactersSAXFunc) sect_title_characters }, { SUBTITLE, "subtitle", (startElementSAXFunc) sect_title_start_element, (endElementSAXFunc) sect_title_end_element, (charactersSAXFunc) sect_title_characters }, { ULINK, "ulink", (startElementSAXFunc) sect_ulink_start_element, (endElementSAXFunc) sect_ulink_end_element, (charactersSAXFunc) sect_write_characters}, - { XREF, "xref", NULL, NULL, NULL}, + { XREF, "xref", (startElementSAXFunc) sect_xref_start_element, NULL, NULL}, { FOOTNOTE, "footnote", (startElementSAXFunc) sect_footnote_start_element, NULL, NULL}, { FIGURE, "figure", NULL, NULL, NULL}, { GRAPHIC, "graphic", NULL, NULL, NULL}, + { CITETITLE, "citetitle", (startElementSAXFunc) sect_em_start_element, (endElementSAXFunc) sect_em_end_element, (charactersSAXFunc) sect_write_characters}, + { APPLICATION, "application", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, + { FILENAME, "filename", NULL, NULL, NULL}, + { ITEMIZED_LIST, "itemized_list", NULL, NULL, NULL}, + { LISTITEM, "listitem", NULL, NULL, NULL}, + { PROGRAMLISTING, "programlisting", (startElementSAXFunc) sect_programlisting_start_element, (endElementSAXFunc) sect_programlisting_end_element, (charactersSAXFunc) sect_write_characters}, + { SGMLTAG, "sgmltag", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, + { EMPHASIS, "EMPHASIS", (startElementSAXFunc) sect_em_start_element, (endElementSAXFunc) sect_em_end_element, (charactersSAXFunc) sect_write_characters}, { UNDEFINED, NULL, NULL, NULL, NULL} }; @@ -617,6 +633,29 @@ sect_ulink_end_element (Context *context, const gchar *name) } static void +sect_xref_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + gchar **atrs_ptr; + + if (!IS_IN_SECT (context)) + return; + + g_print ("<A HREF=\"%s?", context->base_file); + atrs_ptr = (gchar **) atrs; + while (atrs_ptr && *atrs_ptr) { + if (!strcasecmp (*atrs_ptr, "linkend")) { + atrs_ptr++; + g_print ("%s", *atrs_ptr); + break; + } + atrs_ptr += 2; + } + g_print ("\">the section here</A>"); +} + +static void sect_footnote_start_element (Context *context, const gchar *name, const xmlChar **atrs) { GString *footnote; @@ -631,3 +670,67 @@ sect_footnote_start_element (Context *context, const gchar *name, const xmlChar g_print ("<A NAME=\"HEADNOTE%d\" HREF=\"#FOOTNOTE%d\">[%d]</A>", i, i, i); } +static void +sect_em_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + if (!IS_IN_SECT (context)) + return; + + g_print ("<EM>"); +} + +static void +sect_em_end_element (Context *context, + const gchar *name) +{ + if (!IS_IN_SECT (context)) + return; + + g_print ("</EM>"); +} + +static void +sect_tt_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + if (!IS_IN_SECT (context)) + return; + + g_print ("<TT>"); +} + +static void +sect_tt_end_element (Context *context, + const gchar *name) +{ + if (!IS_IN_SECT (context)) + return; + + g_print ("</TT>"); +} + +static void +sect_programlisting_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + if (!IS_IN_SECT (context)) + return; + + g_print ("<table border=\"0\" bgcolor=\"#E0E0E0\" width=\"100%%\">\n<tr><td>\n<pre>\n"); + +} + +static void +sect_programlisting_end_element (Context *context, + const gchar *name) +{ + if (!IS_IN_SECT (context)) + return; + + g_print ("</pre>\n</td></tr>\n</table>\n"); +} + diff --git a/components/help/converters/gnome-db2html2/toc-elements.c b/components/help/converters/gnome-db2html2/toc-elements.c index 6d43816e8..e04bd2bbb 100644 --- a/components/help/converters/gnome-db2html2/toc-elements.c +++ b/components/help/converters/gnome-db2html2/toc-elements.c @@ -49,6 +49,14 @@ ElementInfo toc_elements[] = { { FOOTNOTE, "footnote", NULL, NULL, NULL}, { FIGURE, "figure", NULL, NULL, NULL}, { GRAPHIC, "graphic", NULL, NULL, NULL}, + { CITETITLE, "citetitle", (startElementSAXFunc) html_em_start_element, (endElementSAXFunc) html_em_end_element, (charactersSAXFunc) write_characters}, + { APPLICATION, "application", (startElementSAXFunc) html_tt_start_element, (endElementSAXFunc) html_tt_end_element, (charactersSAXFunc) write_characters}, + { FILENAME, "filename", NULL, NULL, NULL}, + { ITEMIZED_LIST, "itemized_list", NULL, NULL, NULL}, + { LISTITEM, "listitem", NULL, NULL, NULL}, + { PROGRAMLISTING, "programlisting", NULL, NULL, NULL}, + { SGMLTAG, "sgmltag", NULL, NULL, NULL}, + { EMPHASIS, "emphasis", NULL, NULL, NULL}, { UNDEFINED, NULL, NULL, NULL, NULL} }; |