Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > edce90235d3141ac622d60d60f5d922e > files > 70

elinks-0.11.4-1mdv2008.1.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Setting up elinks.conf</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="The ELinks Manual"><link rel="up" href="ch09.html" title="Chapter 9. Introduction to MIME handling"><link rel="prev" href="ch09.html" title="Chapter 9. Introduction to MIME handling"><link rel="next" href="ch10.html" title="Chapter 10. Managing External Viewers with Mailcap"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Setting up elinks.conf</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch09.html">Prev</a> </td><th width="60%" align="center">Chapter 9. Introduction to MIME handling</th><td width="20%" align="right"> <a accesskey="n" href="ch10.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2520595"></a>Setting up elinks.conf</h2></div></div></div><p>If you have old configuration files from old ELinks versions or from Links,
then you may use the conf-links2elinks.pl script (which is placed at
contrib/conv/ on the source distribution) to convert them to the new format.
If you don't use it you will need to edit the configuration file, and here you
will find how.</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2520616"></a>Associating a file extension to a MIME type</h3></div></div></div><p>You can still do this with the UI, from the the Setup-&amp;gt;File Extensions
submenu.</p><p>If you want to do so from the configuration file, enter set mime.extension.ext
= "type", replacing ext with the appropriate file extension, and type with its
MIME type. E.g. you may want to have set mime.extension.jpg = "image/jpeg".</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2520638"></a>Defining a handler</h3></div></div></div><p>For each handler you must define three items, specifying in what context the
value of the item should be applied. You must enter set
mime.handler.handler-name.item.context = value, replacing handler-name with
the name for the handler you are defining, item with the item you are defining
for this handler, context with the context this item value is to be applied,
and value with the value you want to assign to the item. You must do so for
each of the available items: program, ask and block.</p><p>The value for program is a string with the exact command you want to be issued
to view the file, placing % were you would put the file name. The values for
ask and block are either 0 (no) or 1 (yes). Available contexts include unix
and unix-xwin, which mean UNIX text terminal and X respectively (others can be
os2, win32, beos, riscos, …). The latter does not mean you are running
ELinks from X, just that the DISPLAY variable is set so that ELinks may run an
X program.</p><p>To illustrate it, here is an example. Suppose you want to define the
image_viewer handler which should be used to view images.  The configuration
file may look like this:</p><pre class="screen">set mime.handler.image_viewer.unix.ask = 1
set mime.handler.image_viewer.unix-xwin.ask = 0

set mime.handler.image_viewer.unix.block = 1
set mime.handler.image_viewer.unix-xwin.block = 0

set mime.handler.image_viewer.unix.program = "zgv %"
set mime.handler.image_viewer.unix-xwin.program = "xli %"</pre><p>In this example the image_viewer handler uses the svgalib image viewer zgv
when X is not available, and the X image viewer xli when it is. The terminal
would be blocked when X is not available and it would not be when it's
available. Finally, ELinks would ask for confirmation before using the handler
only with X not available.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2520716"></a>Associating a MIME type to a handler</h3></div></div></div><p>Just enter set mime.type.class.name = "handler", replacing class with the
class for the mime type, name with the specific name within that class, and
handler with the name for the handler you want to assign to the MIME type.
E.g. you may want to have set mime.type.image.jpeg = "image_viewer".</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch09.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch09.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch10.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 9. Introduction to MIME handling </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 10. Managing External Viewers with Mailcap</td></tr></table></div></body></html>