r72002 - in /trunk/libapache2-mod-perl2/debian: index.tmpl rules transform_pod2html.pl

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Mon Mar 28 09:03:28 UTC 2011


Author: periapt-guest
Date: Mon Mar 28 08:59:23 2011
New Revision: 72002

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=72002
Log:
got basic index data structure

Added:
    trunk/libapache2-mod-perl2/debian/index.tmpl
Modified:
    trunk/libapache2-mod-perl2/debian/rules
    trunk/libapache2-mod-perl2/debian/transform_pod2html.pl

Added: trunk/libapache2-mod-perl2/debian/index.tmpl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapache2-mod-perl2/debian/index.tmpl?rev=72002&op=file
==============================================================================
--- trunk/libapache2-mod-perl2/debian/index.tmpl (added)
+++ trunk/libapache2-mod-perl2/debian/index.tmpl Mon Mar 28 08:59:23 2011
@@ -1,0 +1,53 @@
+<?xml version="1.0" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>NAME</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rev="made" href="mailto:root at localhost" />
+</head>
+
+<body style="background-color: white">
+
+
+<!-- INDEX BEGIN -->
+<div name="index">
+<p><a name="__index__"></a></p>
+
+<ul>
+
+	<li><a href="#name">NAME</a></li>
+	<ul>
+
+		<li><a href="#api">api</a></li>
+		<li><a href="#devel">devel</a></li>
+		<li><a href="#os">os</a></li>
+		<li><a href="#user">user</a></li>
+	</ul>
+
+</ul>
+
+<hr name="index" />
+</div>
+<!-- INDEX END -->
+
+<p>
+</p>
+<h1><a name="name">NAME</a></h1>
+<p>index</p>
+<p>
+</p>
+<h2><a name="api">api</a></h2>
+<p>
+</p>
+<h2><a name="devel">devel</a></h2>
+<p>
+</p>
+<h2><a name="os">os</a></h2>
+<p>
+</p>
+<h2><a name="user">user</a></h2>
+
+</body>
+
+</html>

Modified: trunk/libapache2-mod-perl2/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapache2-mod-perl2/debian/rules?rev=72002&op=diff
==============================================================================
--- trunk/libapache2-mod-perl2/debian/rules (original)
+++ trunk/libapache2-mod-perl2/debian/rules Mon Mar 28 08:59:23 2011
@@ -25,6 +25,8 @@
 override_dh_clean:
 	dh_clean
 	rm -rf t/htdocs/hooks lib/Apache WrapXS
+        find . -name 'pod2htmd.tmp' -exec rm '{}' \;
+        find . -name 'pod2htmi.tmp' -exec rm '{}' \;
 
 override_dh_install:
 	dh_install

Modified: trunk/libapache2-mod-perl2/debian/transform_pod2html.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libapache2-mod-perl2/debian/transform_pod2html.pl?rev=72002&op=diff
==============================================================================
--- trunk/libapache2-mod-perl2/debian/transform_pod2html.pl (original)
+++ trunk/libapache2-mod-perl2/debian/transform_pod2html.pl Mon Mar 28 08:59:23 2011
@@ -4,6 +4,7 @@
 use File::Find;
 use File::Spec;
 use Pod::Html;
+use HTML::Template;
 use File::Path qw(make_path);
 
 # dependencies: libreadonly-perl
@@ -15,7 +16,15 @@
 croak "No source directory: $SRC_DIR" if not -d $SRC_DIR;
 croak "No destination directory: $DEST_DIR" if not -d $DEST_DIR;
 
+# This data structure will end up being
+# a hierarchical index of the HTML formats of 
+# the pod in the form expected by HTML::Template.
+my %data = (links=>[],sections=>[]);
+
 find( \&transform_pod2html, $SRC_DIR );
+my $template = HTML::Template->new(filename=>"$CUR_DIR/debian/index.tmpl");
+
+exit(0);
 
 sub transform_pod2html {
     return if $File::Find::dir =~ m{/\.svn};
@@ -32,4 +41,31 @@
     my $oldfile = File::Spec->catfile($CUR_DIR, $File::Find::name);
     print "$File::Find::name -> $newfile\n";
     pod2html("--infile=$oldfile", "--outfile=$newfile");
+    index_file($name, $newfile, @dirs);
+    return;
 }
+
+sub index_file {
+    my $name = shift;
+    my $newfile = shift;
+    my @dirs = @_;
+    my $ptr = \%data;
+    foreach my $d (@dirs) {
+        last if $d eq '';
+        $ptr = find_section($ptr, $d);
+    }
+    push @{$ptr->{links}}, {href=>$newfile,text=>$name};
+    return;
+}
+
+sub find_section {
+    my $ptr = shift;
+    my $dir = shift;
+    my @sections = @{$ptr->{sections}};
+    foreach my $s (@sections) {
+        return $s if $s->{title} eq $dir;
+    }
+    my %ldata = (title=>$dir,links=>[],sections=>[]);
+    push @{$ptr->{sections}}, \%ldata;
+    return \%ldata;
+}




More information about the Pkg-perl-cvs-commits mailing list