added abiword + some oofice cleanup
This commit is contained in:
+5
-3
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# @(#$Id: rclabw,v 1.1 2007-06-15 09:25:23 dockes Exp $ (C) 2004 J.F.Dockes
|
||||
# @(#$Id: rclabw,v 1.2 2007-06-15 11:41:50 dockes Exp $ (C) 2004 J.F.Dockes
|
||||
# Parts taken from Estraier:
|
||||
#================================================================
|
||||
# Estraier: a personal full-text search system
|
||||
@@ -97,7 +97,9 @@ encoding=`sed -e '/<?xml version=/s/"?>$//' \
|
||||
if test X$encoding = X ; then encoding=UTF-8;fi
|
||||
|
||||
# Note: there can be newlines inside the description field, we don't want
|
||||
# them...
|
||||
# them... Have 2 use 2 different selectors for the single-line and
|
||||
# multiple-line cases because of the generic tag end (</m> for all meta
|
||||
# tags)
|
||||
descsedprog='
|
||||
/<m key="dc.description">\([^<]*\)<\/m>/ {
|
||||
s//\1/
|
||||
@@ -149,7 +151,7 @@ creator=`sed -n -e "$metasedprog" "$infile"`
|
||||
# a single line in the xml (no multiple <p> per line, no embedded newlines
|
||||
# in text).
|
||||
contentsedprog='
|
||||
/<p /{
|
||||
/<p[ >]/{
|
||||
s/<[^>]*>/ /g
|
||||
p
|
||||
}
|
||||
|
||||
+30
-10
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# @(#$Id: rclsoff,v 1.10 2007-06-08 13:51:09 dockes Exp $ (C) 2004 J.F.Dockes
|
||||
# @(#$Id: rclsoff,v 1.11 2007-06-15 11:41:50 dockes Exp $ (C) 2004 J.F.Dockes
|
||||
# Parts taken from Estraier:
|
||||
#================================================================
|
||||
# Estraier: a personal full-text search system
|
||||
@@ -127,26 +127,45 @@ cd $tmpdir/rclsofftmp
|
||||
descsedprog='/<dc:description>/,/<\/dc:description>/{
|
||||
s!.*<dc:description>!!
|
||||
s!</dc:description>.*!!
|
||||
H
|
||||
${
|
||||
g
|
||||
s/\n/ /g
|
||||
p
|
||||
}
|
||||
}
|
||||
'
|
||||
description=`sed -n -e "$descsedprog" < meta.xml | tr '\n' ' '`
|
||||
description=`sed -n -e "$descsedprog" meta.xml`
|
||||
#echo description "$description"
|
||||
|
||||
subject=`sed -e "s/\"/'/" -e 's/.*<dc:subject>\([^<]*\).*/\1/p;d' < meta.xml`
|
||||
# Takes tag name as parameter and creates sed program to extract single
|
||||
# line meta tags values.
|
||||
setmetasedprog() {
|
||||
metasedprog="s/\"/'/g"'
|
||||
/.*<'"$1"'>\([^<]*\).*/s//\1/p
|
||||
'
|
||||
}
|
||||
|
||||
title=`sed -e "s/\"/'/" -e 's/.*<dc:title>\([^<]*\).*/\1/p;d' < meta.xml`
|
||||
setmetasedprog dc:subject
|
||||
subject=`sed -n -e "$metasedprog" meta.xml`
|
||||
#echo subject: $subject
|
||||
|
||||
keywords=`sed -e "s/\"/'/" -e 's/.*<meta:keyword>\([^<]*\).*/\1/p;d' \
|
||||
< meta.xml`
|
||||
setmetasedprog dc:title
|
||||
title=`sed -n -e "$metasedprog" meta.xml`
|
||||
#echo title: $title
|
||||
|
||||
setmetasedprog meta:keyword
|
||||
keywords=`sed -n -e "$metasedprog" meta.xml`
|
||||
#echo keywords: $keywords
|
||||
|
||||
setmetasedprog dc:creator
|
||||
creator=`sed -n -e "$metasedprog" meta.xml`
|
||||
#echo creator: $creator
|
||||
|
||||
# Note: next expr inserts a newline at each end of paragraph (for preview)
|
||||
content="`sed -e 's!</text:p>!\\
|
||||
!g' -e 's/<[^>]*>/ /g' < content.xml`"
|
||||
|
||||
#echo description "$description"
|
||||
#echo subject "$subject"
|
||||
#echo title "$title"
|
||||
#echo keywords "$keywords"
|
||||
#echo content "$content"
|
||||
|
||||
# output the result
|
||||
@@ -155,6 +174,7 @@ echo '<title>' "$title" '</title>'
|
||||
echo '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">'
|
||||
echo '<meta name="description" content="' "$description $subject" '">'
|
||||
echo '<meta name="keywords" content="' "$keywords" '">'
|
||||
echo '<meta name="author" content="' "$creator" '">'
|
||||
echo '</head><body><p>'
|
||||
|
||||
# The strange 'BEGIN' setup is to prevent 'file' from thinking this file
|
||||
|
||||
Reference in New Issue
Block a user