summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-11-24 17:38:49 (GMT)
committerFred Drake <fdrake@acm.org>1998-11-24 17:38:49 (GMT)
commit6942e57f87c5821b0f80aed3f7c1ddbe251e9a94 (patch)
tree7ee4838d1da1a55537ebb40a1005a349408cf639
parente743fd01acb779dc5585fa64e344ed46510cdd91 (diff)
downloadcpython-6942e57f87c5821b0f80aed3f7c1ddbe251e9a94.zip
cpython-6942e57f87c5821b0f80aed3f7c1ddbe251e9a94.tar.gz
cpython-6942e57f87c5821b0f80aed3f7c1ddbe251e9a94.tar.bz2
Script to convert things like <C/> and <Cpp/> to &C; and &Cpp;. This is
something that con't be done with the DOM as far as I can tell.
-rwxr-xr-xDoc/tools/sgmlconv/fixgenents.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/Doc/tools/sgmlconv/fixgenents.sh b/Doc/tools/sgmlconv/fixgenents.sh
new file mode 100755
index 0000000..220e356
--- /dev/null
+++ b/Doc/tools/sgmlconv/fixgenents.sh
@@ -0,0 +1,25 @@
+#! /bin/sh
+#
+# Script to fix general entities that got translated from the LaTeX as empty
+# elements. Mostly pretty bogus, but works like a charm!
+
+if [ "$1" ]; then
+ exec <"$1"
+ shift 1
+fi
+
+if [ "$1" ]; then
+ exec >"$1"
+ shift 1
+fi
+
+sed '
+s|<ABC/>|\&ABC;|g
+s|<ASCII/>|\&ASCII;|g
+s|<C/>|\&C;|g
+s|<Cpp/>|\&Cpp;|g
+s|<EOF/>|\&EOF;|g
+s|<NULL/>|\&NULL;|g
+s|<POSIX/>|\&POSIX;|g
+s|<UNIX/>|\&UNIX;|g
+' || exit $?