Subject: | PAR support for MKDoc-XML |
Hi Bart,
I've been working on adding support for PAR archives to MKDoc and Petal.
I've attached a diff against v0.75 which has been working for me. It is
passing all existing tests.
Thanks,
William
Subject: | Decode.pm.diff |
--- lib/MKDoc/XML/Decode.pm.orig 2004-10-06 07:44:27.000000000 -0400
+++ lib/MKDoc/XML/Decode.pm 2006-03-06 13:19:31.000000000 -0500
@@ -1,7 +1,7 @@
# -------------------------------------------------------------------------------------
# MKDoc::XML::Decode
# -------------------------------------------------------------------------------------
-# Author : Jean-Michel Hiver
+# Author : Jean-Michel Hiver <jhiver@mkdoc.com>.
# Copyright : (c) MKDoc Holdings Ltd, 2003
#
# This modules expands XML entities & > < " and '.
@@ -21,6 +21,25 @@
# import all plugins once
foreach my $include_dir (@INC)
{
+ my @modules;
+ # handle PAR archives
+ if (ref $include_dir eq 'CODE')
+ {
+ next unless keys %PAR::LibCache; # skip if PAR is not loaded
+ while (my ($filename, $zip) = each %PAR::LibCache)
+ {
+ my @mods = $zip->membersMatching( "MKDoc/XML/Decode/" );
+ foreach my $mod (@mods)
+ {
+ my $fn = $mod->fileName;
+ my ($pm) = $fn =~ /\/(\w+)\.pm$/;
+ #warn "$fn = $pm";
+ push @modules, $pm;
+ }
+ }
+ }
+ else
+ {
my $dir = "$include_dir/MKDoc/XML/Decode";
if (-e $dir and -d $dir)
{
@@ -29,12 +48,14 @@
next;
};
- my @modules = map { s/\.pm$//; $_ }
+ @modules = map { s/\.pm$//; $_ }
grep /\.pm$/,
grep !/^\./,
readdir (DD);
closedir DD;
+ }
+ }
foreach my $module (@modules)
{
@@ -49,7 +70,6 @@
$Modules{$name} = "MKDoc::XML::Decode::$module";
}
- }
}