sidux manual support

This commit is contained in:
dockes 2008-06-09 09:14:37 +00:00
parent 9aa8774f6a
commit 8e8ac49620
5 changed files with 105 additions and 3 deletions

92
src/filters/rclsiduxman Executable file
View File

@ -0,0 +1,92 @@
#!/bin/sh
# @(#$Id: rclsiduxman,v 1.1 2008-06-09 09:12:05 dockes Exp $ (C) 2004 J.F.Dockes
# Parts taken from Estraier:
#================================================================
# Estraier: a personal full-text search system
# Copyright (C) 2003-2004 Mikio Hirabayashi
#================================================================
#================================================================
# rclsiduxman
# Strip the menu part from sidux manual pages to improve search precision
#================================================================
# set variables
LANG=C ; export LANG
LC_ALL=C ; export LC_ALL
progname="rclsiduxman"
filetype="sidux manual htm"
#RECFILTCOMMONCODE
##############################################################################
# !! Leave the previous line unmodified!! Code imported from the
# recfiltcommon file
# Utility code common to all shell filters. This could be sourced at run
# time, but it's slightly more efficient to include the code in the
# filters at build time (with a sed script).
# Describe error in a way that can be interpreted by our caller
senderror()
{
echo RECFILTERROR $*
# Also alert on stderr just in case
echo ":2:$progname::: $*" 1>&2
exit 1
}
iscmd()
{
cmd=$1
case $cmd in
*/*)
if test -x $cmd ; then return 0; else return 1; fi ;;
*)
oldifs=$IFS; IFS=":"; set -- $PATH; IFS=$oldifs
for d in $*;do test -x $d/$cmd && return 0;done
return 1 ;;
esac
}
checkcmds()
{
for cmd in $*;do
if iscmd $cmd
then
a=1
else
senderror HELPERNOTFOUND $cmd
fi
done
}
# show help message
if test $# -ne 1 -o "$1" = "--help"
then
echo "Convert a $filetype file to HTML text for Recoll indexing."
echo "Usage: $progname [infile]"
exit 1
fi
infile="$1"
# check the input file existence (may be '-' for stdin)
if test "X$infile" != X- -a ! -f "$infile"
then
senderror INPUTNOSUCHFILE "$infile"
fi
# protect access to our temp files and directories
umask 77
##############################################################################
# !! Leave the following line unmodified !
#ENDRECFILTCOMMONCODE
checkcmds sed
# Delete everything from <div id="menu"> to <div id="main-page">
# This prints an additional blank line at top which does not matter
sed -n -e '1,/<div id="menu">/{x;p' -e '}' \
-e '/<div id="main-page">/,$p' < $infile
# exit normally
exit 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,4 +1,4 @@
# @(#$Id: mimeconf,v 1.38 2008-02-05 10:45:01 dockes Exp $ (C) 2004 J.F.Dockes
# @(#$Id: mimeconf,v 1.39 2008-06-09 09:12:05 dockes Exp $ (C) 2004 J.F.Dockes
# Recoll : associations of mime types to processing filters.
# There are different sections for decompression, 'interning' for indexing
@ -62,6 +62,7 @@ text/html = internal
text/plain = internal
text/rtf = exec rclrtf
text/x-gaim-log = exec rclgaim
text/x-html-sidux-man = exec rclsiduxman
text/x-mail = internal
text/x-man = exec rclman
@ -103,6 +104,7 @@ message/rfc822 = message
text/html = html
text/plain = txt
text/x-c = source
text/x-html-sidux-man = sidux-book
text/x-mail = message
text/x-man = document
@ -126,6 +128,7 @@ text = \
text/html \
text/plain \
text/rtf \
text/x-html-sidux-man \
text/x-man
spreadsheet = application/vnd.ms-excel \

View File

@ -1,4 +1,4 @@
# @(#$Id: mimemap,v 1.29 2008-02-03 16:24:16 dockes Exp $ (C) 2004 J.F.Dockes
# @(#$Id: mimemap,v 1.30 2008-06-09 09:12:05 dockes Exp $ (C) 2004 J.F.Dockes
# Recoll: associations of file name extensions to mime types
.txt = text/plain
@ -94,6 +94,11 @@ recoll_noindex = .tar.gz .tgz .tar.bz2 .tbz .log.gz .md5 .map \
[~/.gaim]
.txt = text/x-gaim-log
# Special handling of sidux manual menu system
[/usr/share/sidux-manual]
.htm = text/x-html-sidux-man
.html = text/x-html-sidux-man
# Manual files. You may want to adjust the location for your system
# We can't use the default text/troff type because this doesn't say
# what macro set to use (groff -man)

View File

@ -1,4 +1,4 @@
# @(#$Id: mimeview,v 1.11 2008-02-03 16:24:16 dockes Exp $ (C) 2004 J.F.Dockes
# @(#$Id: mimeview,v 1.12 2008-06-09 09:12:05 dockes Exp $ (C) 2004 J.F.Dockes
## ##########################################
# External viewers, launched by the recoll GUI when you click on a result
@ -45,3 +45,5 @@ image/vnd.djvu = djview %f
text/html = firefox %u
text/plain = gnuclient -q %f
text/x-c = gnuclient -q %f
text/x-html-sidux-man = konqueror %f
#text/x-html-sidux-man = iceweasel %f