diff options
author | mail_redacted_for_web | 2015-12-04 02:39:36 +0100 |
---|---|---|
committer | mail_redacted_for_web | 2015-12-04 02:39:36 +0100 |
commit | b49ae08e95f4d4d7d995166e7a2e6f287dc32d14 (patch) | |
tree | 619dfe5f68dfd594c254ed4b3ce50fc66a70c7cf | |
parent | 9a9799ffa596a4ff29cae610dfcd6da2e82dae3c (diff) | |
download | mp3dir2html-b49ae08e95f4d4d7d995166e7a2e6f287dc32d14.tar.bz2 |
Give a letter's 1st occurence an HTML id, improved ampersand replacing
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | bin/mp3dir2html | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -22,7 +22,7 @@ sedawk-exists: @command -v awk > /dev/null uninstall: - @rm -v /usr/local/share/man/man1/mp3dir2html.1.gz /usr/local/bin/mp3dir2html + @rm -vf /usr/local/share/man/man1/mp3dir2html.1.gz /usr/local/bin/mp3dir2html .PHONY: help diff --git a/bin/mp3dir2html b/bin/mp3dir2html index fcb5494..ce90f0b 100755 --- a/bin/mp3dir2html +++ b/bin/mp3dir2html @@ -44,7 +44,7 @@ function m3l_prep_table { sed 's/========.*/====/g' | sed 's/\t$/\t" "/g' | tr '\n' '\t' |\ sed 's/====/\n====/g;s/====\t/====/g' |\ sed 's/Artist\t//;s/Title\t//;s/Album\t//;s/\(.*\)Year\t/\1/;s/\(.*\)Track\t/\1/' |\ - uniq | sed 's/====//g;s/\ &\ /\ \&\;\ /g' | tr -s '\n' |\ + uniq | sed 's/====//g;s/&/\&\;/g' | tr -s '\n' |\ sed 's/\t0\t/\t"0"\t/g' } @@ -67,4 +67,8 @@ sed 's/^/<tr><td>/g;s/\t/<\/td><td>/g;s/$/<\/td><\/tr>/g' content.csv >> content rm content.csv echo -e '\n\n</table>\n</div>\n</div>\n</body>\n</html>' >> content.php +for i in `seq 0 9` `echo {A..Z}` `echo {a..z}`;do + sed -i -e "0,/^<tr><td>\($i\)/ s/^<tr><td>\($i\)/<tr><td id=\"_\\1\">\\1/" content.php +done + echo |