release-notes/devel/xmlbeats xmlfix, NONE, 1.1 steps-to-convert-FC6.txt, NONE, 1.1
Paul W. Frields (pfrields)
fedora-docs-commits at redhat.com
Sun Sep 24 20:00:57 UTC 2006
Author: pfrields
Update of /cvs/docs/release-notes/devel/xmlbeats
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30544
Added Files:
xmlfix steps-to-convert-FC6.txt
Log Message:
Fixes to make nice beats
--- NEW FILE xmlfix ---
#!/bin/bash
#
# Take the output files from the "beatconvert" script and make them
# palatable for updating CVS.
#
print_usage() {
echo "Usage: $0 [<beatdir>] [<docs-common-dir>]"
echo " <beatdir>: folder containing conversions of Beats (default $PWD)"
echo " <docs-common-dir>: location of docs-common module"
}
case $1 in
-h|--help )
print_usage && exit 0
;;
* )
;;
esac
BEATDIR="$1"
[ $# -lt 2 ] && COMMON="../../../docs-common" || COMMON="$2"
if [ ! -d "$COMMON" ]; then
echo "$COMMON is not the docs-common you're looking for."
exit 1
fi
XMLFORMAT="${COMMON}/bin/xmlformat"
XMLFORMATCONF="${COMMON}/bin/xmlformat-fdp.conf"
[ -f "$XMLFORMAT" ] || ( echo "No xmlformat found" && exit 1 )
[ -f "$XMLFORMATCONF" ] || (echo "No xmlformat-fdp.conf found" && exit 1 )
mkdir -p Fixed/ || ( echo "Couldn't make a directory here" && exit 1 )
for i in $BEATDIR/*; do
OUTXML="$(basename "$i").xml"
eval "$XMLFORMAT -f $XMLFORMATCONF ${i} > $OUTXML"
sed -i 's@<\(/\)\?article>@<\1section>@' $OUTXML
sed -i 's@<!DOCTYPE article@<!DOCTYPE section@' $OUTXML
# Yes this is hacky. So sue me.
sed -i "s@^<section@<section id=\"sn-${i}\"@" $OUTXML
NEWTITLE=$(grep 'RAW HTML:' $OUTXML | sed 's at .\+<h2>\([^<]\+\).\+@\1@')
sed -i "s@^ <title>.\+@ <title>${NEWTITLE}</title>@" $OUTXML
done
--- NEW FILE steps-to-convert-FC6.txt ---
0. Remove any existing "Beats" folder in the local directory, and make
sure the "beatlist" file contains all the beats you need to pull.
Include the parents of any sub-beats!
1. Use beatconvert to pull the beats from the main wiki to the test
wiki and convert to XML. **This will take several minutes because
the test wiki disallows access if you hit it too often within a
certain (unknown) span of time. Pay attention and Ctrl+\ to quit
if needed!**
./beatconvert beatlist
The results are in the "Beats" folder.
2. Run xmlfix to get the section ID's and titles fixed.
./xmlfix Beats/
The results are in the "Fixed" folder.
3. Edit, copy to the relnotes devel/en_US folder, and commit. Don't
forget to "make pot" also!
PWF, 2006-09-24
More information about the Fedora-docs-commits
mailing list