lynx-dev
[Top][All Lists]
Advanced

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

Re: LYNX-DEV Re: Suggestion: parse .shtml as an HTML file


From: Foteos Macrides
Subject: Re: LYNX-DEV Re: Suggestion: parse .shtml as an HTML file
Date: Tue, 05 Aug 1997 09:39:37 -0500 (EST)

address@hidden (Yutaka Uratochi) wrote:
>  Hi, lynx-developers.  Thank you all for your answer to my question.
>They helped a lot ! 
>  I'm the original asker.  I'm posting the summary.
>  My original question was:
>
>>>   Nowadays, more and more HTML files has extension other than .html.
>>> For example, .shtml for SSI HTML, .phtml for PHP/FI embedded HTML.
>>> Browsing those HTML files from the command line like this:
>>> 
>>>   % lynx index.phtml
>>> 
>>> doesn't parse HTML tags, because lynx assume it is a plain text.
>>>   I want lynx to recognize files as HTML files, if the files have 
>>> extensions defined in lynx.cfg like:
>>> 
>>>   HTML_EXTENSIONS:html,shtml,phtml
>
>
>  Answers I got:
>[...]
>>> Just create a .mime.types file in your home directory (or edit the global 
>>> one if you can), and add a line like
>>> 
>>> text/html                      html, shtml, phtml, htmlx
>>> 
>>> Alternately, this can be done from within lynx.cfg:
>>> 
>>> SUFFIX:.shtml:text/html
>
>  This way is most efficient and elegant.  I am now happy with this 
>solution.
>
>  I will put this solution to my page in both English and Japanese, so
>people around the Net can share.

        The default suffix to MIME type mappings are set in src/HTInit.c.
For text/html, they presently include:

    HTSetSuffix(".htm",         "text/html", "8bit", 1.0);
    HTSetSuffix(".html3",       "text/html", "8bit", 1.0);
    HTSetSuffix(".ht3",         "text/html", "8bit", 1.0);
    HTSetSuffix(".shtml",       "text/html", "8bit", 1.0);
    HTSetSuffix(".htmlx",       "text/html", "8bit", 1.0);
    HTSetSuffix(".html",        "text/html", "8bit", 1.0);

Those definitions will override any SUFFIX: mappings in lynx.cfg, and
correspondingly, Lynx will treat .html, .shtml and .htmlx as text/html
whether you do that in SUFFIX: maps or not.  The .phtml suffix for
SSIs did not exist (or at least, I didn't know about it), when the
HTSetSuffix() entries were last updated in HTInit.c, so you still can
put that in lynx.cfg.  However, anything in a global mime.types file
which overlaps with anything in lynx.cfg or HTInit.c will cause a
replacement, and in turn, any overlaps in a personal mime.types file
will cause replacements, and become the ultimate suffix to MIME type
mappings.

        Also be clear that suffix mappings are used only for file and
ftp URLs.  For http/https, the Content-Type indicated by the server
is used (or the Content-Encoding, if one is present and you are
downloading, rather than rendering for display by Lynx or passing
the returned stream as a temporary file to a helper application).
For gopher, the gtype in the URL is used.  For the other supported
URLs, which are "gateways" in Lynx, the returned stream is converted
to text/html and rendered as if it were received with that Content-Type
from an http server.

                                Fote

=========================================================================
 Foteos Macrides            Worcester Foundation for Biomedical Research
 address@hidden         222 Maple Avenue, Shrewsbury, MA 01545
=========================================================================
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

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