about summary refs log tree commit diff stats
path: root/trunk/hapaxlink.sh
diff options
context:
space:
mode:
authorCase Duckworth2015-04-14 16:36:17 -0700
committerCase Duckworth2015-04-14 16:36:17 -0700
commit9fce418b46c9f0894f429384ef9e3dabaeffbeb4 (patch)
treeb2339220ee50cf48b8887f0cc1fed4813a95901b /trunk/hapaxlink.sh
parentAdd toc metadata (diff)
downloadautocento-9fce418b46c9f0894f429384ef9e3dabaeffbeb4.tar.gz
autocento-9fce418b46c9f0894f429384ef9e3dabaeffbeb4.zip
Change file hierarchy and rewrite makefile
- File hierarchy is now as follows:
    - /
        - appendix/  < appendix source files
        - backlinks/ < backlink sources & builds
        - hapax/     < *.hapax source files
        - scripts/   < scripts, like *.js, *.hs, etc.
        - templates/ < templates for outputs
        - text/      < source files
        - trunk/     < assets, like css, images, heads, etc.
        - index.html
        - *.html
        - Makefile
Diffstat (limited to 'trunk/hapaxlink.sh')
-rw-r--r--trunk/hapaxlink.sh26
1 files changed, 0 insertions, 26 deletions
diff --git a/trunk/hapaxlink.sh b/trunk/hapaxlink.sh deleted file mode 100644 index 286c43d..0000000 --- a/trunk/hapaxlink.sh +++ /dev/null
@@ -1,26 +0,0 @@
1#!/bin/bash
2
3file="$1";
4headFile="$2";
5shift 2;
6glob="$@"; # *.hapax
7
8tempFile="${RANDOM}.tmp"
9
10echo -n "Linking \"$file\""
11# Begin
12cat "$headFile" > "$tempFile";
13echo -n "."
14# Link words to files they appear in
15for word in `sort "$file"`; do
16 f=`grep -liwq "^$word$" $glob`;
17 link="`basename $f .hapax`.html"
18 echo "[$word]($link)" >> "$tempFile";
19 echo -n "."
20done
21
22# Make the changes happen
23rm "$file"
24mv "$tempFile" "$file"
25
26echo "Done."