File: gen_doc.sh

package info (click to toggle)
libticables3 3.9.6-10
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,656 kB
  • ctags: 2,184
  • sloc: ansic: 15,996; sh: 9,298; makefile: 526; yacc: 288; awk: 145; sed: 16
file content (38 lines) | stat: -rwxr-xr-x 756 bytes parent folder | download | duplicates (7)
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
#! /bin/sh

SRC=./text
TMP=/tmp/doc
DST=./html
TPL=./tmpl
TBL=./index

# Scan the 'text' folder and list keywords

echo "Create list of keywords..."
ls -l --color=never ./text | awk -f index.awk | sort > $TBL
rm -f $TMP/*.*
rm -f $DST/*.*

# Copy template files and hand-written files

cp $TPL/*.* $DST

# Generate an html file starting at a text file

echo "Pass #1: text -> html conversion..."
mkdir $TMP >/dev/null 2>&1
for I in $SRC/*.txt ; do \
#    echo $I
    cat $I | awk -f pass1.awk src=$I dst=$TMP
done

# Re-parse html file for cross-references
# to do with an awk script again

echo "Pass #2: html -> html cross-referencing..."
for I in $TMP/*.html ; do \
#    echo $I
    cat $I | awk -f pass2.awk src=$I tbl=$TBL dst=$DST
done

echo "Done !"