summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2005-11-23 06:40:25 +0000
committerTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2005-11-23 06:40:25 +0000
commitb6af6ce1dbb7ec2c746b0dc8dffb3395aded6cde (patch)
tree18d1df17e51966bea77edac9b53acc39e6dd2de5 /bin
parent876749686ff81014214c615b6b6f39f919ec7f32 (diff)
downloadfedora-doc-utils-b6af6ce1dbb7ec2c746b0dc8dffb3395aded6cde.tar.gz
fedora-doc-utils-b6af6ce1dbb7ec2c746b0dc8dffb3395aded6cde.tar.xz
fedora-doc-utils-b6af6ce1dbb7ec2c746b0dc8dffb3395aded6cde.zip
Shell script to switch to the "DRAFT" CSS stylesheet in an HTML directory.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/use-draft-css36
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/use-draft-css b/bin/use-draft-css
new file mode 100755
index 0000000..5041ece
--- /dev/null
+++ b/bin/use-draft-css
@@ -0,0 +1,36 @@
+#!/bin/bash
+########################################################################
+# Tommy.Reynolds <Tommy.Reynolds@MegaCoder.com>
+# International copyright secured (C) 2005, All rights reserved.
+# This software is licensed under the GPL.
+########################################################################
+# Do surgery on the *.html files to reference the draft CSS stylesheet
+#
+# Use like this:
+#
+# use-draft-css /path/to/docdir
+#
+########################################################################
+# You will need to manually copy "../css/fedora-draft.css" and
+# "../images/watermark.png" into the HTML's top-level directory.
+########################################################################
+USAGE="usage: $(basename $0) /path/to/docdir"
+SILENT=yes
+while getopts v c
+do
+ case "${c}" in
+ v ) SILENT="";;
+ * ) echo "${USAGE}" >&2; exit 1;;
+ esac
+done
+shift $(expr ${OPTIND} - 1)
+if [ $# -gt 1 ]; then
+ echo "${USAGE}" >&2
+ exit 1
+fi
+find ${1:-.} -iname '*.html' -print |
+while read f; do
+ [ "${SILENT}" ] || echo ${f}
+ sed 's/href="fedora.css"/href="fedora-draft.css"/' ${f} >${f}.tmp
+ mv ${f}.tmp ${f}
+done