Re: reflexion
On Wed, Apr 11, 2001 at 02:43:10PM +0200, JM Bourdaret wrote:
>
> i don't know gnome or kde , but it is the purpose of the menu system
>
> are you saying that kde and gnome doesn't use the menu(tm) (bug)?
>
> and/or is there a special need for an HTML output of the menus ?
> eh! that's a great idea ! to make a menu-method that create HTML !
> it could be of use elsewhere.... and shouldn't be too hard to code :)
Well, here's a rudimentary start (attached)[1]. I have no idea how to
break it up into multiple files, but it might be worth it, if this
seems like a good idea. Comments?
There's no way to run them from this file, and there's also no way to
know which apps are supported (i.e. X programs won't run from console,
but I can certainly browse this html file from the console).
[snip]
[1] Put the file (html) in /etc/menu-methods, and make it executable.
Then run update menus. It plops a .html file in /etc/debian_menu.html.
(in theory, if run as non-root, it plops the file in ~/debian_menu.html
but this is not tested.)
I'm not sure where exactly this file should go. Also note that it will
only show programs that "needs=x11", but it is trivial to change.
Comments appreciated.
--
Pat Mahoney <patmahoney@gmx.net>
For children with short attention spans: boomerangs that don't come back.
#!/usr/sbin/install-menu
#
# Generates an xhtml menu with all registered applications.
compat="menu-2"
!include menu.h
genmenu="debian_menu.html"
rootprefix="/etc/"
userprefix=""
treewalk=(cm)
rootsection="/Debian"
# There's got to be a better way to do this...
# If $description and $longtitle are equal, they must both be null.
# If there's a $description, print it, else print $longtitle.
function description()= \
ifeq($description,$longtitle,"No description available.") \
ifelse($description,$description,$longtitle) \
supported
x11= "<img src='"$icon"' alt='Icon for "$title"' /><dl>\n<dt>"$title"</dt>\n<dd>"description()"</dd></dl>\n"
endsupported
preoutput="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" \
\n \
<head> \
<title>Debian applications</title> \
</head> \
\n<html><body>"
postoutput="</html></body>"
mainmenutitle="Debian"
startmenu= "\n<b>***"title()"***</b><blockquote>\n"
endmenu= "\n</blockquote>\n"
Reply to: