comparison help/generate.sh @ 495:e6141a238811

A bit more Help
author Chris Cannam
date Thu, 18 Aug 2011 17:13:04 +0100
parents 41a156d439d0
children fb95d70c80d5
comparison
equal deleted inserted replaced
494:41a156d439d0 495:e6141a238811
21 s/^{[\w\s]+}//s; 21 s/^{[\w\s]+}//s;
22 s/^(\s*)([A-Za-z][^\n]*)/$1<h2>$2<\/h2>/s; 22 s/^(\s*)([A-Za-z][^\n]*)/$1<h2>$2<\/h2>/s;
23 s/^\s+\*\s+(.*)$/<ul><li>$1<\/li><\/ul>/gm; 23 s/^\s+\*\s+(.*)$/<ul><li>$1<\/li><\/ul>/gm;
24 s/"([\w])/&ldquo;$1/gs; 24 s/"([\w])/&ldquo;$1/gs;
25 s/([\w])"/$1&rdquo;/gs; 25 s/([\w])"/$1&rdquo;/gs;
26 s/^\#([^\s]+)$/<center><img src="images\/$1"><\/center>/gm; 26 s/^\#([^\s]+)$/<center><img src="images\/$1.png"><\/center>/gm;
27 s/\n-+\n/\n/gs; 27 s/\n-+\n/\n/gs;
28 s/\n\n([^\n])/\n\n<p>$1/gs; 28 s/\n\n([^\n])/\n\n<p>$1/gs;
29 s/^\n*([^<\n])/\n<p>$1/gs; 29 s/^\n*([^<\n])/\n<p>$1/gs;
30 s/^\n*(<[^p])/\n<p>$1/gs; 30 s/^\n*(<[^p])/\n<p>$1/gs;
31 s/([^\n])\n\n/$1<\/p>\n\n/gs; 31 s/([^\n])\n\n/$1<\/p>\n\n/gs;
46 46
47 category=`grep '^{.*}$' "$x" | sed 's/[{}]//g'` 47 category=`grep '^{.*}$' "$x" | sed 's/[{}]//g'`
48 48
49 if [ "$category" != "$pcat" ]; then 49 if [ "$category" != "$pcat" ]; then
50 echo "<h3>$category</h3>" >> topics.html 50 echo "<h3>$category</h3>" >> topics.html
51 pcat="$category"
51 fi 52 fi
52 53
53 grep '<h2>' "$out" | sed "s|<h2>|<p><a href=\"$out\">|" | sed 's/<\/h2>/<\/a><\/p>/' >> topics.html 54 grep '<h2>' "$out" | sed "s|<h2>|<p><a href=\"$out\">|" | sed 's/<\/h2>/<\/a><\/p>/' >> topics.html
54 55
55 done 56 done