mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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.
This commit is contained in:
parent
e743fd01ac
commit
6942e57f87
1 changed files with 25 additions and 0 deletions
25
Doc/tools/sgmlconv/fixgenents.sh
Executable file
25
Doc/tools/sgmlconv/fixgenents.sh
Executable file
|
@ -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 $?
|
Loading…
Add table
Add a link
Reference in a new issue