diff options
author | 2010-11-08 15:34:21 +0100 | |
---|---|---|
committer | 2010-11-08 15:34:21 +0100 | |
commit | 8b679e6cd374bf32bfabc2009070b5f15ac0d305 (patch) | |
tree | 70451c3eb790031637bbf583e2290dd6238db95a /dopreview.sh | |
parent | add usage blurb (diff) | |
download | hardened-docs-8b679e6cd374bf32bfabc2009070b5f15ac0d305.tar.gz hardened-docs-8b679e6cd374bf32bfabc2009070b5f15ac0d305.tar.bz2 hardened-docs-8b679e6cd374bf32bfabc2009070b5f15ac0d305.zip |
Added a fancy preview generator, maybe we should hook it?
Diffstat (limited to 'dopreview.sh')
-rwxr-xr-x | dopreview.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/dopreview.sh b/dopreview.sh new file mode 100755 index 0000000..7f9ed6b --- /dev/null +++ b/dopreview.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ $# -ne 0 ]; +then + echo "Usage: $0"; + echo ""; + echo "This script will generate and fix the HTML files inside this directory."; + echo "For this having gorg installed is necessary."; + exit 1; +fi + +if [ -z "$(whereis -b gorg | cut -d: -f2)" ]; + then + echo "gorg not found, can't continue without it :("; + exit 1; +fi + +for FILE in *.xml; +do + output=$(basename $FILE .xml).html + gorg < $FILE | \ + sed -e 's|"/css/main.css"|"http://www.gentoo.org/css/main.css"|g' \ + -e 's|"../../../|"http://www.gentoo.org/|g' \ + -e 's|"/images/|"http://www.gentoo.org/images/|g' | \ + tr -d "\302" | tr -d "\240" > $output; +done |