# Recoll user manual
Writing a document input handler

Sidebar | Prev | Up | Next

### Input handler HTML output

The output HTML could be very minimal like the following example:

    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
      </head>
      <body>
       Some text content
      </body>
    </html>

You should take care to escape some characters inside the text by transforming them into appropriate entities. At the very minimum, "`&`" should be transformed into "`&amp;`", "`<`" should be transformed into "`&lt;`". This is not always properly done by translating programs which output HTML, and of course never by those which output plain text.

When encapsulating plain text in an HTML body, the display of a preview may be improved by enclosing the text inside `<pre>` tags.

The character set needs to be specified in the header. It does not need to be UTF-8 (Recoll will take care of translating it), but it must be accurate for good results.

Recoll will process `meta` tags inside the header as possible document fields candidates. Documents fields can be processed by the indexer in different ways, for searching or displaying inside query results. This is described in a following section.

By default, the indexer will process the standard header fields if they are present: `title`, `meta/description`, and `meta/keywords` are both indexed and stored for query-time display.

A predefined non-standard `meta` tag will also be processed by Recoll without further configuration: if a `date` tag is present and has the right format, it will be used as the document date (for display and sorting), in preference to the file modification date. The date format should be as follows:

    <meta name="date" content="YYYY-mm-dd HH:MM:SS">
    or
    <meta name="date" content="YYYY-mm-ddTHH:MM:SS">

Example:

    <meta name="date" content="2013-02-24 17:50:00">

Input handlers also have the possibility to "invent" field names. This should also be output as meta tags:

    <meta name="somefield" content="Some textual data" />

You can embed HTML markup inside the content of custom fields, for improving the display inside result lists. In this case, add a (wildly non-standard) `markup` attribute to tell Recoll that the value is HTML and should not be escaped for display.

    <meta name="somefield" markup="html" content="Some <i>textual</i> data" />

As written above, the processing of fields is described in a further section.

Prev | Up | Next
| Home |