diff options
author | Case Duckworth | 2015-04-14 16:36:17 -0700 |
---|---|---|
committer | Case Duckworth | 2015-04-14 16:36:17 -0700 |
commit | 9fce418b46c9f0894f429384ef9e3dabaeffbeb4 (patch) | |
tree | b2339220ee50cf48b8887f0cc1fed4813a95901b /trunk/hapaxlink.sh | |
parent | Add toc metadata (diff) | |
download | autocento-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.sh | 26 |
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 | |||
3 | file="$1"; | ||
4 | headFile="$2"; | ||
5 | shift 2; | ||
6 | glob="$@"; # *.hapax | ||
7 | |||
8 | tempFile="${RANDOM}.tmp" | ||
9 | |||
10 | echo -n "Linking \"$file\"" | ||
11 | # Begin | ||
12 | cat "$headFile" > "$tempFile"; | ||
13 | echo -n "." | ||
14 | # Link words to files they appear in | ||
15 | for 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 "." | ||
20 | done | ||
21 | |||
22 | # Make the changes happen | ||
23 | rm "$file" | ||
24 | mv "$tempFile" "$file" | ||
25 | |||
26 | echo "Done." | ||