File: docsrc2html.sh

package info (click to toggle)
vdr-plugin-epgsearch 1.0.1~beta6%2Bgit20150211-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,780 kB
  • ctags: 2,325
  • sloc: ansic: 23,325; perl: 1,330; sh: 609; makefile: 197
file content (42 lines) | stat: -rwxr-xr-x 832 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
#
# Creates the html pages
#
# Needs: pod2html
#
# Mike Constabel
#
# Version 0.1 - 24.09.2006
#

DOCSRC="doc-src"

if [ ! -s "epgsearch.c" ]; then
	echo "Cannot find epgsearch.c. Call this script from epgsearch source directory."
	exit
fi

VERSION="$(awk -F\" '/VERSION/ {print $2; exit;}' epgsearch.c)"

for LANGUAGE in $(ls "$DOCSRC"/); do

	[ ! -d ""$DOCSRC"/$LANGUAGE" ] && continue
	mkdir -p html/$LANGUAGE
	rm html/$LANGUAGE/* 2>/dev/null

	for i in "$DOCSRC"/$LANGUAGE/*.txt; do
		echo -ne "create html page: ($LANGUAGE) $(basename "$i" ".txt")..."
		pod2html --infile="$i" --outfile="html/$LANGUAGE/$(basename "$i" ".txt").html" --norecurse --title="Epgsearch Version $VERSION"
		if [ $? -eq 0 ]; then
			echo " done."
		else
			echo " failed."
		fi
	done

	rm "$DOCSRC"/$LANGUAGE/*~ 2>/dev/null
done

echo

#EOF