recoll/website/faqsandhowtos/FilterRetrofit.txt
Jean-Francois Dockes 821fb780d2 web
2017-06-05 11:57:26 +02:00

63 lines
2.1 KiB
Plaintext

== Installing a filter for a new document type
It will sometimes happen that a newer Recoll release has support for a
document type which would be useful to you, but which your older release
does not support.
It is in general easy to import support from the newer to the older
release: the Recoll input handler interface is very stable, so things should just
work.
Input Handler updates are generally described on the Recoll web site
link:https://www.recoll.org/filters/filters.html[new filters pages]. They
may include notes about which versions need the new input handler, or specifics
about installing it.
An up to date copy of input handlers and configuration files is also kept
link:https://www.recoll.org/filters/[at the same location].
We will take an example to make things more concrete: Tomboy and Gnote
files are directly supported by Recoll 1.19, but not in older Recoll
releases. The *rclxml* handler is needed to process them.
The following procedure will allow you to retrofit support:
- Retrieve the *rclxml* input handler from:
link:https://www.lesbonscomptes.com/recoll/filters/rclxml[]
- Copy it to '/usr/share/recoll/filters' and make it executable:
`chmod +x rclxml`
The input handler needs *xsltproc*, but this is probably already on your
system (else get it with the package manager).
- Edit '~/.recoll/mimemap', add the following line:
`.note = application/x-gnote`
- Edit '~/.recoll/mimeconf', add the following lines:
+
----
[index]
application/x-gnote = exec rclxml
----
- Edit '~/.recoll/mimeview', add the following lines:
+
----
[view]
application/x-gnote = tomboy %f
----
- The easiest way to make sure the files are indexed with the new input
handlers may then be to just run a full indexing pass (`recollindex -z`).
Notes:
- The MIME type which is used is not crucial, you could prefer to use,
e.g., +application/x-tomboy+ instead, it just has to be consistent. To
avoid future trouble, it's better to use the type used by newer Recoll
releases though.
- The 'mimeview' entry is necessary even if you are using the desktop
preferences to open files. The value will not be used, but it has to be
there.