Files -> HTML

Anil Madhavapeddy anil@recoil.org
Fri, 23 Mar 2001 21:05:35 +0000


I've been looking at sorting out Chora's HTML rendering of checkouts, and
the enscript stuff is working quite nicely now.  What I thought would be the
best solution is to take out IMP's current MIME rendering code and pull it
back into Horde.  Then add in the current Chora Enscript support to the mix,
which would give all the applications that need it this capability as well
(so IMP could pretty print code attachments, Gollem/Chora could take
advantage of IMP's tar, xls, doc viewers).

However, the enscript stuff isn't currently keyed from the MIME type.  It
has to use the file extensions, since most web-servers dont assign .c, .cpp,
.pl files special MIME types (that I can tell).  Since this is generally all
part of the text/plain content type, I suppose the way to handle this is to
examine the filename in the text/plain MIME handler to see if we can do
anything special there.

Just how much do we want to abstract all this?  I quite like the way IMP
does things at the moment, but lib/mimetypes.php does intrude on the global
namespace.  A driver approach (Render.php , Render/enscript.php,
Render/wv.php, Render/tar.php, Render/php.php) would probably be better, and
make it easier to add stuff.  Then all we need is a central config file that
would map either MIME types or file extensions to one of the drivers, and we
are sorted.

Any comments on this before I start on it?

PS: I think I might as well integrate Chora with Horde.  I'll take a 
snapshot of what's here in CVS at some point later, write up some
documentation, and release that standalone.  If people want all this cool
new functionality, they can go install Horde ;-)

--
Anil Madhavapeddy, <anil@recoil.org>