diff options
Diffstat (limited to 'trunk/first-lines.sh')
-rw-r--r-- | trunk/first-lines.sh | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/trunk/first-lines.sh b/trunk/first-lines.sh deleted file mode 100644 index 1378a82..0000000 --- a/trunk/first-lines.sh +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | outFile="$1"; | ||
4 | shift 1; | ||
5 | glob="$@"; | ||
6 | |||
7 | firstLineOf() { # $1 = file | ||
8 | endOfYaml=$(sed -n '/^\.\.\.$/=' "$1") | ||
9 | tryLineNumber=$((endOfYaml + 1)) | ||
10 | try="" | ||
11 | while [[ -z $try ]]; do | ||
12 | try=$(head -n $tryLineNumber "$1" | tail -n 1 |\ | ||
13 | sed -e 's/^[|>] //' -e 's/[][]//g' -e 's/^#.*//' -e 's/^--.*//') | ||
14 | (( tryLineNumber += 1 )) | ||
15 | done | ||
16 | echo "$try" | ||
17 | } | ||
18 | |||
19 | echo -n "Compiling ${outFile}" | ||
20 | |||
21 | for file in $glob; do | ||
22 | # Copy first line to $outFile & link | ||
23 | echo "[$(firstLineOf "$file")](${file%.*}.html)" >> $outFile; | ||
24 | echo -n "."; | ||
25 | done | ||
26 | echo "Done." | ||