lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] lynx offers only D or C for a .css-file ("file" says "C p


From: Stef Caunter
Subject: Re: [Lynx-dev] lynx offers only D or C for a .css-file ("file" says "C prog): how to DISPLAY? - patch submit
Date: Sat, 21 Jan 2006 04:06:56 -0500 (EST)

this entry in .mailcap works by calling a pager:

text/css; less %s; copiousoutput

But this is not ideal, and it would be a good feature to include css browsing.

Here is a patch which adds css to HTInit.c and seems to work when I recompile; lynx displays the css file as plain text.

using diff -rub

--- orig/lynx2-8-6/src/HTInit.c 2005-01-05 19:42:15.000000000 -0500
+++ lynx2-8-6/src/HTInit.c      2006-01-21 03:31:29.000000000 -0500
@@ -114,6 +114,7 @@
      */
     SET_INTERNL("application/html", "text/x-c", HTMLToC, 0.5);
     SET_INTERNL("application/html", "text/plain", HTMLToPlain, 0.5);
+    SET_INTERNL("text/css", "text/plain", HTMLToPlain, 0.5);
     SET_INTERNL("application/html", "www/present", HTMLPresent, 2.0);
     SET_INTERNL("application/xhtml+xml", "www/present", HTMLPresent, 2.0);
     SET_INTERNL("application/xml", "www/present", HTMLPresent, 2.0);
@@ -143,6 +144,7 @@
     SET_INTERNL("text/x-sgml", "www/present", HTMLPresent, 2.0);
     SET_INTERNL("text/sgml", "www/source", HTPlainPresent, 1.0);
     SET_INTERNL("text/sgml", "www/present", HTMLPresent, 1.0);
+    SET_INTERNL("text/css", "www/present", HTPlainPresent, 1.0);
     SET_INTERNL("text/plain", "www/present", HTPlainPresent, 1.0);
     SET_INTERNL("text/plain", "www/source", HTPlainPresent, 1.0);
     SET_INTERNL("text/html", "www/source", HTPlainPresent, 1.0);
@@ -1287,6 +1289,7 @@
        SET_SUFFIX1(".c",     "text/plain",                 "8bit");
        SET_SUFFIX1(".cc",    "text/plain",                 "8bit");
        SET_SUFFIX1(".c++",   "text/plain",                 "8bit");
+       SET_SUFFIX1(".css",   "text/plain",                 "8bit");
        SET_SUFFIX1(".h",     "text/plain",                 "8bit");
        SET_SUFFIX1(".pl",    "text/plain",                 "8bit");
        SET_SUFFIX1(".text",  "text/plain",                 "8bit");



here are some relevant parts of a trace which shows css accepted.

                Lynx Trace Log (2.8.6dev.16)

parse_arg(arg_name=cbc.ca/includes/cbc.css, mask=4, count=2)
parse_arg startfile:cbc.ca/includes/cbc.css
HTFormat: Looking up presentation for text/plain to www/present
FindPresentation: found exact match: text/plain
HTFormat: Looking up presentation for text/html to www/present
FindPresentation: found exact match: text/html

HTTP/1.0 200 OK
HTFormat: Constructing stream stack for www/mime to www/present ((null))
HTFormat: Looking up presentation for www/mime to www/present
HTFormat: comparing audio/* and www/mime for half match
HTFormat: comparing image/* and www/mime for half match
HTFormat: comparing video/* and www/mime for half match
StreamStack: found weak wildcard match: www/present
FindPresentation: found exact match: www/mime
StreamStack: found exact match: www/mime
StreamStack: Returning "MIMEParser"
HTMIME:  Server: Apache/1.3.29 (Linux/SUSE) mod_gzip/1.3.26.1a mod_jk/1.2.6-dev
Last-Modified: Tue, 09 Sep 2003 18:52:20 GMT
ETag: "1a419a-18d3-3f5e2164"
Accept-Ranges: bytes
Content-Type: text/css
Content-Encoding: gzip
Content-Length: 979
Expires: Sat, 21 Jan 2006 08:14:27 GMT
Date: Sat, 21 Jan 2006 08:04:27 GMT
Vary: Accept-Encoding

HTMIME: MIME Content-Type is 'text/css',
        Treating as 'www/compressed'.  Converting to 'www/present'
HTFormat: Constructing stream stack for www/compressed to www/present (text/css)
HTFormat: Looking up presentation for www/compressed to www/present
HTFormat: comparing audio/* and www/compressed for half match
HTFormat: comparing image/* and www/compressed for half match
HTFormat: comparing video/* and www/compressed for half match
StreamStack: found weak wildcard match: www/present
FindPresentation: found exact match: www/compressed
StreamStack: found exact match: www/compressed
LYOpenTemp(,.txt.gz,wb)

HTLoadFile: Opening `/tmp/lynx00012313aa/L12313-371TMP.txt' gives 0x48216298
File mode is 0100600, uid=1000, gid=0. My uid=1000, 2 groups ( 100 0)
HTCompressFileType(/tmp/lynx00012313aa/L12313-371TMP.txt) returns 0:
HTFormat: Constructing stream stack for text/css to www/present (text/css)
HTFormat: Looking up presentation for text/css to www/present
HTFormat: comparing audio/* and text/css for half match
HTFormat: comparing image/* and text/css for half match
HTFormat: comparing video/* and text/css for half match
FindPresentation: found exact match: text/css
StreamStack: found exact match: text/css
UCSetTransParams: from iso-8859-1(0) to iso-8859-1(0)
GridText: start HText_new
UCSetTransParams: from iso-8859-1(0) to iso-8859-1(0)
GridText: Change to style Example
StreamStack: Returning "PlainPresenter"

HTAccess:  status=200
HTAccess: `http://www.cbc.ca/includes/cbc.css' has been accessed.

-Stef
http://caunter.ca/contact.html

On Fri, 20 Jan 2006, David Combs wrote:

Try connecting to this site:


  Linkname: AUE: The alt.usage.english Home Page
       URL: http://alt-usage-english.org/index.shtml

       URL: http://alt-usage-english.org/aue.css    <<<<======

(the css-file discovered via the source)

Right, it's not a true html-file, but it is plain-text ("file"
 thinks it's a c-program).

Downloading and then "more" (or "page") works fine.

BUT, it'd be nice to be able to have LYNX display it!

Is there any way to do that?

If not, then maybe some way to override the D or C choice?

Thanks,

David






reply via email to

[Prev in Thread] Current Thread [Next in Thread]