diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2006-01-30 23:47:55 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2006-01-30 23:47:55 +0000 |
commit | 670e99c494ce05bab0577b1f2dd85da38af5de11 (patch) | |
tree | f6627033cb1201c41f0ee213bf729bfba232f16f | |
parent | dabe9a68aa9516e3f65930456df05f2046f471aa (diff) | |
download | yelp-670e99c494ce05bab0577b1f2dd85da38af5de11.tar.gz |
- Bury man and info under 'Command Line Help'
* configure.in:
* src/yelp-toc-pager.c:
* stylesheets/toc2html.xsl:
- Bury man and info under 'Command Line Help'
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | configure.in | 7 | ||||
-rw-r--r-- | src/yelp-toc-pager.c | 43 | ||||
-rw-r--r-- | stylesheets/toc2html.xsl | 6 |
4 files changed, 37 insertions, 26 deletions
@@ -1,3 +1,10 @@ +2006-01-30 Shaun McCance <shaunm@gnome.org> + + * configure.in: + * src/yelp-toc-pager.c: + * stylesheets/toc2html.xsl: + - Bury man and info under 'Command Line Help' + 2006-01-29 Don Scorgie <dscorgie@cvs.gnome.org> * src/yelp-html.cpp: diff --git a/configure.in b/configure.in index 794f4726..3abe9b8d 100644 --- a/configure.in +++ b/configure.in @@ -150,6 +150,13 @@ else AM_CONDITIONAL(ENABLE_INFO, false) fi +if test "x$enable_man" = "xyes" -o "x$enable_info" = "xyes"; then + AC_DEFINE(ENABLE_MAN_OR_INFO, 1, [turn of man page or GNU info support]) + AM_CONDITIONAL(ENABLE_MAN_OR_INFO, true) +else + AM_CONDITIONAL(ENABLE_MAN_OR_INFO, false) +fi + dnl ****** dnl beagle diff --git a/src/yelp-toc-pager.c b/src/yelp-toc-pager.c index f6ba8a06..17f4df52 100644 --- a/src/yelp-toc-pager.c +++ b/src/yelp-toc-pager.c @@ -1207,34 +1207,31 @@ process_read_menu (YelpTocPager *pager) for (i = 0; i < obj->nodesetval->nodeNr; i++) { xmlNodePtr node = obj->nodesetval->nodeTab[i]; xmlChar *icon = NULL; -#ifdef ENABLE_MAN +#ifdef ENABLE_MAN_OR_INFO xmlChar *id = NULL; -#endif -#ifdef ENABLE_INFO - xmlChar *infoid = NULL; -#endif - -#ifdef ENABLE_MAN + xmlNodePtr cmdhelp; + xmlNodePtr newnode; id = xmlGetProp (node, BAD_CAST "id"); if (!xmlStrcmp (id, BAD_CAST "index")) { - xmlNodePtr new = xmlNewChild (node, NULL, BAD_CAST "toc", NULL); - xmlNewNsProp (new, NULL, BAD_CAST "id", BAD_CAST "Man"); - xmlNewChild (new, NULL, BAD_CAST "title", - BAD_CAST _("Manual Pages")); - } - xmlFree (id); -#endif - + cmdhelp = xmlNewChild (node, NULL, BAD_CAST "toc", NULL); + xmlNewNsProp (cmdhelp, NULL, BAD_CAST "id", BAD_CAST "ManInfoHolder"); + xmlNewChild (cmdhelp, NULL, BAD_CAST "title", + BAD_CAST _("Command Line Help")); +#ifdef ENABLE_MAN + newnode = xmlNewChild (cmdhelp, NULL, BAD_CAST "toc", NULL); + xmlNewNsProp (newnode, NULL, BAD_CAST "id", BAD_CAST "Man"); + xmlNewChild (newnode, NULL, BAD_CAST "title", + BAD_CAST _("Manual Pages")); +#endif // ENABLE_MAN #ifdef ENABLE_INFO - infoid = xmlGetProp (node, BAD_CAST "id"); - if (!xmlStrcmp (infoid, BAD_CAST "index")) { - xmlNodePtr new = xmlNewChild (node, NULL, BAD_CAST "toc", NULL); - xmlNewNsProp (new, NULL, BAD_CAST "id", BAD_CAST "Info"); - xmlNewChild (new, NULL, BAD_CAST "title", - BAD_CAST _("GNU Info Pages")); + newnode = xmlNewChild (cmdhelp, NULL, BAD_CAST "toc", NULL); + xmlNewNsProp (newnode, NULL, BAD_CAST "id", BAD_CAST "Info"); + xmlNewChild (newnode, NULL, BAD_CAST "title", + BAD_CAST _("GNU Info Pages")); +#endif //ENABLE_INFO } - xmlFree (infoid); -#endif + xmlFree (id); +#endif //ENABLE_MAN_OR_INFO xml_trim_titles (node); diff --git a/stylesheets/toc2html.xsl b/stylesheets/toc2html.xsl index 1723f0fb..15a81b14 100644 --- a/stylesheets/toc2html.xsl +++ b/stylesheets/toc2html.xsl @@ -108,7 +108,7 @@ </body> </html> </yelp:document> - <xsl:apply-templates select="toc[.//doc[1]]"/> + <xsl:apply-templates select="toc[(.//doc[1]) or (@id = 'ManInfoHolder')]"/> </xsl:template> <xsl:template mode="body.mode" match="toc"> @@ -122,10 +122,10 @@ <div class="leftbar"> </div> <div class="rightbar"> - <xsl:if test="toc[.//doc]"> + <xsl:if test="toc[.//doc] or @id = 'ManInfoHolder'"> <div class="tocs"> <ul> - <xsl:for-each select="toc[../@id = 'index' or .//doc]"> + <xsl:for-each select="toc[../@id = 'index' or ../@id = 'ManInfoHolder' or .//doc]"> <xsl:sort select="number(../@id = 'index') * position()"/> <xsl:sort select="normalize-space(title)"/> <li class="toc"> |