Author: mcbrown
Date: 2007-08-05 19:25:13 +0200 (Sun, 05 Aug 2007)
New Revision: 7339
Log:
Adding a prep-for-chm.pl script that reformats the source.xml file to fix image references, remove xml:base (which confuses the situation). Modifications to the make machinery
Removing DRBD how-to, now the HA/DRBD chapter is live
Added:
trunk/tools/prep-for-chm.pl
Removed:
trunk/refman-5.0/drbd-how-to.xml
Modified:
trunk/make.d/vars-docbook
trunk/make.d/xml-chm
Property changes on: trunk/tools/prep-for-chm.pl
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/make.d/vars-docbook
===================================================================
--- trunk/make.d/vars-docbook 2007-08-05 14:44:09 UTC (rev 7338)
+++ trunk/make.d/vars-docbook 2007-08-05 17:25:13 UTC (rev 7339)
Changed blocks: 1, Lines Added: 4, Lines Deleted: 0; 498 bytes
@@ -205,6 +205,10 @@
REMAP_IMG_PATHS = $(TOOLS_DIR)/remap-img-paths.pl
+# Script that remaps pathnames and removes xml:base references
+
+PREP_FOR_CHM = $(TOOLS_DIR)/prep-for-chm.pl
+
# ----------------------------------------------------------------------
# Transforms
Modified: trunk/make.d/xml-chm
===================================================================
--- trunk/make.d/xml-chm 2007-08-05 14:44:09 UTC (rev 7338)
+++ trunk/make.d/xml-chm 2007-08-05 17:25:13 UTC (rev 7339)
Changed blocks: 1, Lines Added: 1, Lines Deleted: 1; 433 bytes
@@ -18,7 +18,7 @@
if [ "x$$IMAGE_FILES" != "x" ]; then \
mkdir $@-tmp/images; \
cp $$IMAGE_FILES $@-tmp/images; \
- $(REMAP_IMG_PATHS) $@-tmp/source.xml; \
+ $(PREP_FOR_CHM) $@-tmp/source.xml; \
fi
mv $@-tmp $@
Added: trunk/tools/prep-for-chm.pl
===================================================================
--- trunk/tools/prep-for-chm.pl (rev 0)
+++ trunk/tools/prep-for-chm.pl 2007-08-05 17:25:13 UTC (rev 7339)
Changed blocks: 1, Lines Added: 28, Lines Deleted: 0; 1060 bytes
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+# prep-for-chm.pl - preps files for CHM generation
+
+# Usage: prep-for-chm.pl file ...
+
+# Performs two processes:
+# Map fileref="xxxx/basename.suffix" -> fileref="image/basename.suffix"
+# Remove xml:base references to prevent imag references being remapped
+
+use strict;
+use warnings;
+use Getopt::Long;
+
+foreach my $file_name (@ARGV)
+{
+ open (IN, $file_name) or die "Cannot read $file_name: $!\n";
+ my @lines = <IN>;
+ close (IN);
+ foreach (@lines)
+ {
+ s|(<imagedata [^>]*fileref=")[^"]*(/[^/"]+)"|$1images$2"|g;
+ s|xml:base="[^"]*(/[^/"]+)"||g;
+ }
+ open (OUT, ">$file_name") or die "Cannot write $file_name: $!\n";
+ print OUT @lines;
+ close (OUT);
+}
Property changes on: trunk/tools/prep-for-chm.pl
___________________________________________________________________
Name: svn:executable
+ *
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r7339 - in trunk: make.d refman-5.0 tools | mcbrown | 5 Aug |