I just wondered if there was a method to force dillo to treat a file given on the command line as HTML. I'd like to use dillo to view html attachments from my mail program, but since the temporary file doesn't have .htm[l] as an extension (actually, it is extension free) so dillo just displays the html instead of interpreting it. I don't mind working on a patch if this capability doesn't already exist, but before embarking down that path I thought I'd check with the experts as I didn't see a reference to this "problem". Thanks. -- /~\ The ASCII Ken Weinert mc@quarter-flash.com \ / Ribbon Campaign 303-452-6603 (V) 303-705-4258 (F) X Against HTML GnuPG: 9274F1CE GnuPG available at http://www.gnupg.org/ / \ Email! 1D87 3720 BB77 4489 A928 79D6 F8EC DD76 9274 F1CE Press <CTRL>-<ALT>-<DEL> to continue ...
On Tue, Mar 11, 2003 at 04:47:02PM -0700, Kenneth D. Weinert wrote:
I just wondered if there was a method to force dillo to treat a file given on the command line as HTML.
Not really an answer to your question, but ...
I'd like to use dillo to view html attachments from my mail program, but since the temporary file doesn't have .htm[l] as an extension (actually, it is extension free) so dillo just displays the html instead of interpreting it.
... reading the "user-agent" from your header, I figured you are using mutt. Then add the following into .mailcap : text/html; dillo %s; nametemplate=%s.html That's what I have :-) It may work for other MUA's as well. Optinally, add a test. Cheers Andreas -- **************************** NEW ADDRESS ****************************** Hamburger Sternwarte Universitaet Hamburg Gojenbergsweg 112 Tel. ++49 40 42891 4016 D-21029 Hamburg, Germany Fax. ++49 40 42891 4198
Kenneth,
I just wondered if there was a method to force dillo to treat a file given on the command line as HTML.
No, but read on!
I'd like to use dillo to view html attachments from my mail program, but since the temporary file doesn't have .htm[l] as an extension (actually, it is extension free) so dillo just displays the html instead of interpreting it.
When listing directories, dillo analizes the filename extension to know what type a file is. If there's no extension, plain text is used. Now, I just commited a patch to the CVS that when analizes the file's data when its filename doesn't have an extension. The process is more tricky than it seems at first sight. Because lots of trouble come when a filetype is misdetected. I added this commet to file.c: /* Content type info: as we may misdetect a lot of files, * every unknown type is rendered as "text/plain". * todo: a better approach could be to detect&reject thosetypes we know * for sure we don't handle (as gzip, bzip, ELF, etc) */ Now, dillo tries to detect the file type (among the few types it knows how to handle), but if forced (clicking the file), it renders as plain text. It works quite nice for me, and it should solve your problem.
I don't mind working on a patch if this capability doesn't already exist, but before embarking down that path I thought I'd check with the experts as I didn't see a reference to this "problem".
Well, if someone has time, it'd be good to detect gzip & bzip2 and not to try to render them as plain text (because it makes little sense and wastes memory cache). For that purpose, a little extension to a_Misc_get_content_type_from_data (based on /etc/magic logic) is required, and also arranging the details: for instance, showing "Compressed" as file type in directory listings, and sending a message to the status bar when those files are clicked. Something like: "Sorry, I don't know how to display this file" That'd be nice for now. Sometime in the future, this file type can be used to handle the file to other programs/viewers using the dpi gateway. Cheers Jorge.- PS: but please bear in mind that dillo is not a file browser! :)
participants (3)
-
Andreas Schweitzer
-
Jorge Arellano Cid
-
Kenneth D. Weinert