Fixed the man filter to get rid of groff temp files, and add a few possible extensions for man pages. Closes issue #56
This commit is contained in:
parent
75ba4a2169
commit
6dcf21b8e5
@ -86,17 +86,39 @@ umask 77
|
|||||||
|
|
||||||
checkcmds groff
|
checkcmds groff
|
||||||
|
|
||||||
|
# We need a temporary directory
|
||||||
|
if test z"$RECOLL_TMPDIR" != z; then
|
||||||
|
ttdir=$RECOLL_TMPDIR
|
||||||
|
elif test z"$TMPDIR" != z ; then
|
||||||
|
ttdir=$TMPDIR
|
||||||
|
else
|
||||||
|
ttdir=/tmp
|
||||||
|
fi
|
||||||
|
tmpdir=$ttdir/rclman_tmp$$
|
||||||
|
mkdir $tmpdir || exit 1
|
||||||
|
mkdir $tmpdir/rclmantmp || exit 1
|
||||||
|
|
||||||
|
cleanup()
|
||||||
|
{
|
||||||
|
# Note that we're using a constant part (rclmantmp), that hopefully
|
||||||
|
# guarantees that we can't do big mistakes here.
|
||||||
|
rm -rf $tmpdir/rclmantmp
|
||||||
|
rmdir $tmpdir
|
||||||
|
}
|
||||||
|
|
||||||
|
trap cleanup EXIT HUP QUIT INT TERM
|
||||||
|
|
||||||
# Note: the qt preview really likes to find an <html> tag at the top
|
# Note: the qt preview really likes to find an <html> tag at the top
|
||||||
echo '<html>'
|
echo '<html>'
|
||||||
|
|
||||||
# Filter out some unwanted data when indexing
|
# Filter out some unwanted data when indexing
|
||||||
if test X$RECOLL_FILTER_FORPREVIEW = Xyes ; then
|
if test X$RECOLL_FILTER_FORPREVIEW = Xyes ; then
|
||||||
groff -man -Thtml < "$infile"
|
(cd $tmpdir/rclmantmp; groff -man -Thtml) < "$infile"
|
||||||
else
|
else
|
||||||
# When indexing we try to avoid adding terms for the section headers, which
|
# When indexing we try to avoid adding terms for the section headers, which
|
||||||
# are unfortunately somewhat ill defined. We eliminate rather loosely
|
# are unfortunately somewhat ill defined. We eliminate rather loosely
|
||||||
# lines containing likely section header words preceded by a tag.
|
# lines containing likely section header words preceded by a tag.
|
||||||
groff -man -Thtml < "$infile" | \
|
(cd $tmpdir/rclmantmp; groff -man -Thtml) < "$infile" | \
|
||||||
egrep -v \
|
egrep -v \
|
||||||
'>NAME|>SYNOPSIS|>DESCRIPTION|>EXIT|>OPTIONS|>DIAGNOSTICS|>SUPPORTED HARDWARE|>CONFIGURATION|>AUTHOR|>BUGS|>REPORTING BUGS|>KNOWN BUGS|>COPYRIGHT|>SEE ALSO|>HISTORY|>ENVIRONMENT|>FILES'
|
'>NAME|>SYNOPSIS|>DESCRIPTION|>EXIT|>OPTIONS|>DIAGNOSTICS|>SUPPORTED HARDWARE|>CONFIGURATION|>AUTHOR|>BUGS|>REPORTING BUGS|>KNOWN BUGS|>COPYRIGHT|>SEE ALSO|>HISTORY|>ENVIRONMENT|>FILES'
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -150,14 +150,31 @@ recoll_noindex = .tar.gz .tgz .tar.bz2 .tbz .log.gz .md5 .map \
|
|||||||
# We can't use the default text/troff type because this doesn't say
|
# We can't use the default text/troff type because this doesn't say
|
||||||
# what macro set to use (groff -man)
|
# what macro set to use (groff -man)
|
||||||
[/usr/share/man]
|
[/usr/share/man]
|
||||||
|
.0p = text/x-man
|
||||||
.1 = text/x-man
|
.1 = text/x-man
|
||||||
|
.1m = text/x-man
|
||||||
|
.1p = text/x-man
|
||||||
|
.1ssl = text/x-man
|
||||||
|
.1x = text/x-man
|
||||||
.2 = text/x-man
|
.2 = text/x-man
|
||||||
.3 = text/x-man
|
.3 = text/x-man
|
||||||
|
.3curses = text/x-man
|
||||||
|
.3form = text/x-man
|
||||||
|
.3gl = text/x-man
|
||||||
|
.3menu = text/x-man
|
||||||
|
.3ncurses = text/x-man
|
||||||
|
.3p = text/x-man
|
||||||
|
.3pm = text/x-man
|
||||||
|
.3ssl = text/x-man
|
||||||
|
.3tiff = text/x-man
|
||||||
|
.3x = text/x-man
|
||||||
.4 = text/x-man
|
.4 = text/x-man
|
||||||
.5 = text/x-man
|
.5 = text/x-man
|
||||||
|
.5ssl = text/x-man
|
||||||
.6 = text/x-man
|
.6 = text/x-man
|
||||||
|
.6x = text/x-man
|
||||||
.7 = text/x-man
|
.7 = text/x-man
|
||||||
|
.7ssl = text/x-man
|
||||||
.8 = text/x-man
|
.8 = text/x-man
|
||||||
.9 = text/x-man
|
.9 = text/x-man
|
||||||
.n = text/x-man
|
.n = text/x-man
|
||||||
.3pm = text/x-man
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user