$(echo "$aline" | cut -d: -f$bylinefield)"
fi
echo "" > "$articletemp"
sequence="${date:0:4}${date:5:2}${date:8:2}${date:11:2}${date:14:2}"
expr "$(echo "$sequence" | cut -c9-12)" : "[012][0-9][0-5][0-9]\$" >/dev/null ||
sequence="$(echo "$sequence" | cut -c1-8)"
echo "_CHAPTER(\`\`${title:-$aline}'', \`\`L$sequence'')$byline" >> "$articletemp"
copy=on
;;
[12][0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]*)
copy=off
;;
[$spacetab-]*[^$spacetab]*|[a-zA-Z0-9][.\)]*|[1-9][0-9][.\)]*)
[ "$pre" = "off" -a "$copy" = "on" ] &&
echo "" >> "$articletemp" &&
pre=on && newpara=false
[ "$copy" = "on" ] && echo "$aline" >> "$articletemp"
;;
[Ii]mage:*)
image=$(echo "$aline" | cut -d: -f2 | awk '{print $1}')
fullpath=$(mdfind -onlyin $HOME/Sites "kMDItemFSName = *$image*" | grep /Thumbnails/ | head -1)
imagetitle=$(echo "$image" | sed 's/[-_]/ /g')
if [ "$fullpath" != "" ]
then
imagepath=$(echo "$fullpath" | sed 's&/Thumbnails/&/&')
base=$(basename "$imagepath")
dir=$(dirname "$imagepath")
[ ! -f "$dir/index.html" ] &&
dir="$(dirname "$dir")"
if [ -f "$dir/index.html" ] &&
[ $(grep -c "$base" "$dir/index.html") -gt 0 ]
then
imagepath="$dir/index.html"
fi
fullpath=$(echo "$fullpath" |
sed "s&^$WEBBASE&DIR_TOP&")
imagepath=$(echo "$imagepath" |
sed "s&^$WEBBASE&DIR_TOP&")
echo "_IMAGE($fullpath, ALT=\"$imagetitle\" ALIGN=RIGHT)" >> "$articletemp"
elif fullpath=$(mdfind -onlyin $HOME/Sites "kMDItemFSName = *$image*" | head -1) ; [ "$fullpath" != "" ]
then
fullpath=$(echo "$fullpath" |
sed "s&^$WEBBASE&DIR_TOP&")
echo "_THUMBNAIL($fullpath, 180, 150, ALT=\"$imagetitle\" ALIGN=RIGHT)" >> "$articletemp"
fi
;;
[Mm]ood:*)
mood=$(echo "$aline" | cut -d: -f2 | tr 'A-Z' 'a-z')
basemood=$(echo "$mood" |
sed -e 's/[^a-zA-Z]*//' -e 's/[^a-zA-Z]*$//')
if [ "$mood" != "" ]
then
echo "" >> "$articletemp"
if [ -f "$WEBBASE/Graphics/Mood/$basemood.gif" ]
then
echo "_IMAGE(DIR_GFX/Mood/$basemood.gif, ALT=\"$mood\", 50)" >> "$articletemp"
fi
echo "Mood: $mood" >> "$articletemp"
echo "" >> "$articletemp"
fi
;;
*)
if [ "$copy" = "on" ]
then
[ "$pre" = "on" ] &&
echo "" >> "$articletemp" &&
pre=off && newpara=false
[ "$aline" != "" -a "$newpara" = "true" ] &&
newpara=false &&
echo "" >> "$articletemp" [ "$aline" = "" ] && newpara=true echo "$aline" >> "$articletemp" fi ;; esac done | sed -e 's/^_\([A-Za-z][^A-Z]\)/\1/' \ -e 's/\([ (]\)_\([a-zA-Z]\)/\1\2/g' \ -e 's&\([a-zA-Z0-9!?.]\)_\([^a-zA-Z0-9]\)&\1\2&g' \ -e 's&\([a-zA-Z0-9!?.]\)_$&\1&' >> "$maintemp" realname=$(finger $USER | head -1 | sed 's/.*Name: *//') firstname=$(echo "$realname" | awk '{print $1}') echo "m4_include(stddefs.m4) m4_include(DIR_INCLUDE/toc3.m4) _HEADER(\`\`$firstname's journal: $year'', \`\`\$Id: diary,v 1.17 2007/10/25 20:54:01 perette Exp $'')" > "$build" [ -f "$journaldir/journalmenu.m4" ] && echo "m4_include(journalmenu.m4)" >> "$build" echo "_DOCTITLE(\`\`$firstname's journal: $year'')" >> "$build" echo "_STYLE(\`\`H2 { clear: left; margin-bottom: 0.1ex; }'')" >> "$build" if [ "$direction" = "reverse" ] then echo "m4_define(\`\`_TOC_HEADER'', \`\`'')" >> "$build" echo "m4_define(\`\`_CHAPTER_TOC'', \`\`'')" >> "$build" echo "m4_define(\`\`_TOC_END'', \`\`'')" >> "$build" echo "m4_define(\`\`_CHAPTER_HEADER'', \`\`