[Rt-commit] [svn] r953 - in RT-OnlineDocs/trunk: . html
html/Callbacks html/Callbacks/RT-OnlineDocs
html/Callbacks/RT-OnlineDocs/Elements
html/Callbacks/RT-OnlineDocs/Elements/Tabs html/Developer
html/Developer/Perldoc lib lib/RT
jesse at pallas.eruditorum.org
jesse at pallas.eruditorum.org
Wed May 26 02:11:43 EDT 2004
Author: jesse
Date: Wed May 26 02:11:43 2004
New Revision: 953
Added:
RT-OnlineDocs/trunk/META.yml
RT-OnlineDocs/trunk/Makefile.PL
RT-OnlineDocs/trunk/html/
RT-OnlineDocs/trunk/html/Callbacks/
RT-OnlineDocs/trunk/html/Callbacks/RT-OnlineDocs/
RT-OnlineDocs/trunk/html/Callbacks/RT-OnlineDocs/Elements/
RT-OnlineDocs/trunk/html/Callbacks/RT-OnlineDocs/Elements/Tabs/
RT-OnlineDocs/trunk/html/Callbacks/RT-OnlineDocs/Elements/Tabs/Default
RT-OnlineDocs/trunk/html/Developer/
RT-OnlineDocs/trunk/html/Developer/Perldoc/
RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html
RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html
RT-OnlineDocs/trunk/html/Developer/Perldoc/index.html
RT-OnlineDocs/trunk/lib/
RT-OnlineDocs/trunk/lib/RT/
RT-OnlineDocs/trunk/lib/RT/OnlineDocs.pm
Log:
Initial commit of the RT-OnlineDocs extension
Added: RT-OnlineDocs/trunk/META.yml
==============================================================================
--- (empty file)
+++ RT-OnlineDocs/trunk/META.yml Wed May 26 02:11:43 2004
@@ -0,0 +1,13 @@
+name: RT-OnlineDocs
+version: 0.01_01
+abstract: RT OnlineDocs Extension
+author: Jesse Vincent <jesse at bestpractical.com>
+license: GPLv2
+distribution_type: module
+requires:
+ Pod::Simple::HTML: 0
+no_index:
+ directory:
+ - html
+ - inc
+generated_by: Module::Install version 0.33
Added: RT-OnlineDocs/trunk/Makefile.PL
==============================================================================
--- (empty file)
+++ RT-OnlineDocs/trunk/Makefile.PL Wed May 26 02:11:43 2004
@@ -0,0 +1,7 @@
+use inc::Module::Install;
+RTx('RT-OnlineDocs');
+version_from ('lib/RT/OnlineDocs.pm');
+author('Jesse Vincent <jesse at bestpractical.com>');
+requires('Pod::Simple::HTML');
+license('GPLv2');
+&WriteAll;
Added: RT-OnlineDocs/trunk/html/Callbacks/RT-OnlineDocs/Elements/Tabs/Default
==============================================================================
--- (empty file)
+++ RT-OnlineDocs/trunk/html/Callbacks/RT-OnlineDocs/Elements/Tabs/Default Wed May 26 02:11:43 2004
@@ -0,0 +1,25 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+
+<%init>
+$toptabs->{'ZZ-RTFM'} = { title =>loc("API Documentation"),
+ path => "Developer/Perldoc/index.html" };
+</%init>
+<%args>
+$toptabs =>undef
+</%args>
Added: RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html
==============================================================================
--- (empty file)
+++ RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html Wed May 26 02:11:43 2004
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
+<head>
+<title><% $n || 'RT' %> - RT Pod Online</title>
+<style type="text/css"><!--
+a { text-decoration: none }
+a:hover { text-decoration: underline }
+a:focus { background: #99ff99; border: 1px black dotted }
+--></style>
+</head>
+<body>
+<%PERL>
+my $dirname = File::Basename::dirname($INC{'RT.pm'});
+$n =~ s/::/\//g;
+$n = 'RT' unless -r "$dirname/$n.pm";
+my $show = "$dirname/$n";
+if (-r "$show.pm") {
+ local $/;
+ my $got_name = 0;
+
+ my $total_body = '';
+
+ foreach my $postfix ('', '_Overlay', '_Vendor', '_Local') {
+ my $fh;
+ next unless -r "$show$postfix.pm";
+ open $fh, "$show$postfix.pm" or next;
+ my $body = <$fh>;
+ if ($body =~ s/.*Create takes a hash of values and creates a row in the
+database:([^=]+)//s) {
+ # okay, reduce it...
+ $body = "=head1 SCHEMA\n\n$1\n=head1 ACCESSORS\n\n\n=cut\n$body";
+ $body =~ s/=item/=head2/g;
+ }
+ elsif ($body =~ /^=item NewItem$/m and $n =~ /s$/) {
+ my $pkg = $n;
+ $pkg =~ s{/}{::}g;
+ chop $pkg;
+ $body = "=head1 NAME\n\n${pkg}s - Collection of $pkg
+objects\n\n=cut\n";
+ $got_name++;
+ }
+ else {
+ $body =~ s/^=head1 NAME[^=]+//m if $got_name;
+ }
+
+ $body =~ s/^=head1\b(?! ACCESSORS).*\s*(?==(head1|cut))//mg;
+ $body =~ s/^=head1 (?:AUTHOR|SEE ALSO|SYNOPSIS)\s*[^=]+//mg;
+ $body =~ s/^=/\n=/mg;
+ $body =~ s/^=begin testing\n/=begin testing\n\n/mg;
+ close $fh;
+
+ $total_body .= $body;
+ }
+ my $body;
+ my $converter = Pod::Simple::HTML->new();
+ $converter->output_string(\$body);
+ $converter->parse_string_document($total_body);
+ $body =~ s{.*?<body [^>]+>}{}s;
+ $body =~ s{</body>\s*</html>\s*$}{};
+ $n =~ s{/}{::}g;
+ $m->print("<h1>$n</h1>");
+ $body =~ s/(?<!\$)\b(RT::[a-zA-Z0-9:]+)\b/<a href="Body.html?n=$1">$1<\/a>/g;
+ $body =~ s{(?<![\$:])(?<!RT::)\b((?!RT::)\w+::\w+)\b}{<a
+href="http://search.cpan.org/search?query=$1&mode=module">$1</a>}g;
+ $body =~ s!</li>\n\t<ul>!<ul>!;
+ $body =~ s!</ul>!</ul></li>!;
+ $body =~ s!<p></p>!!;
+ $body =~ s!<a name=!<a id=!g;
+ $body =~ s!__index__!index!g;
+ $m->print($body);
+}
+</%PERL>
+</body></html>
+<%ARGS>
+$Target => '&method=Body'
+$n => ''
+</%ARGS>
+<%INIT>
+require File::Basename;
+require File::Find;
+require File::Temp;
+require File::Spec;
+require Pod::Simple::HTML;
+</%INIT>
Added: RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html
==============================================================================
--- (empty file)
+++ RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html Wed May 26 02:11:43 2004
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
+<head>
+<title><% $n || 'RT' %> - RT Developer Documentation Online</title>
+<style type="text/css"><!--
+a { text-decoration: none }
+a:hover { text-decoration: underline }
+a:focus { background: #99ff99; border: 1px black dotted }
+--></style>
+</head>
+<body style="background: #dddddd">
+<%PERL>
+my $dirname = File::Basename::dirname($INC{'RT.pm'});
+my @found;
+File::Find::find(
+ { untaint => 1,
+ wanted => sub {
+ return unless /(\w+)\.pm$/;
+ return if $1 =~ /_/;
+ my $name = $File::Find::name;
+ $name =~ s/.*lib\b.//;
+ $name =~ s!\.pm!!i;
+ $name =~ s!\W!::!g;
+ push @found, $name;
+ },follow => ($^O ne 'MSWin32') },
+ $dirname,
+);
+my ($prev, $indent);
+foreach my $file (sort @found) {
+ my ($parent, $name) = ($1, $2) if $file =~ /(?:(.*)::)?(\w+)$/;
+ if ($file =~ /^$prev\::(.*)/) {
+ my $foo = $1;
+ while ($foo =~ s/(\w+):://) {
+ $indent++;
+ $m->print((' ' x $indent));
+ $m->print("$1<br />");
+ }
+ $indent++;
+ } elsif ($prev !~ /^$parent\::/) {
+ while ($parent =~ s/(\w+)//) {
+ next if $prev =~ s/\b$1:://;
+ while ($prev =~ s/:://) {
+ $indent--;
+ }
+ $m->print((' ' x $indent));
+ $m->print("$1<br />");
+ $indent++;
+ }
+ } elsif ($prev =~ /^$parent\::(.*::)/) {
+ my $foo = $1;
+ while ($foo =~ s/:://) {
+ $indent--;
+ }
+ }
+ $m->print( ( ' ' x $indent )
+ . '<a target="podBody" href="Body.html?n=' . $file . '">' . $name
+ . '</a><br />' ."\n" );
+ $prev = $file;
+}
+
+</%PERL>
+</body></html>
+<%INIT>
+require File::Basename;
+require File::Find;
+require File::Temp;
+require File::Spec;
+require Pod::Simple::HTML;
+</%INIT>
+<%ARGS>
+$n => ''
+$method => ''
+$Target => '&method=Body'
+</%ARGS>
Added: RT-OnlineDocs/trunk/html/Developer/Perldoc/index.html
==============================================================================
--- (empty file)
+++ RT-OnlineDocs/trunk/html/Developer/Perldoc/index.html Wed May 26 02:11:43 2004
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
+"http://www.w3.org/TR/html4/">
+<html lang="en">
+<head>
+<title><% $n || 'RT' %> - RT Pod Online</title>
+<style type="text/css"><!--
+a { text-decoration: none }
+a:hover { text-decoration: underline }
+a:focus { background: #99ff99; border: 1px black dotted }
+--></style>
+</head>
+<FRAMESET COLS="*, 250">
+ <FRAME src="Body.html" name="podBody">
+ <FRAME src="TOC.html" name="podTOC">
+ <NOFRAMES>
+ <a style="display: none" href="#toc">Table of Contents</a>
+<& Body.html, Target => '' &>
+ <h1><a id="toc">Table of Contents</a></h1>
+<& TOC.html, Target => '' &>
+ </NOFRAMES>
+</FRAMESET>
+<%args>
+$n => undef
+</%args>
Added: RT-OnlineDocs/trunk/lib/RT/OnlineDocs.pm
==============================================================================
--- (empty file)
+++ RT-OnlineDocs/trunk/lib/RT/OnlineDocs.pm Wed May 26 02:11:43 2004
@@ -0,0 +1,9 @@
+# Copyright 1996-2004 Best Practical Solutions, LLC
+#
+
+use strict;
+use warnings;
+
+our $VERSION = "0.01_01";
+
+1;
More information about the Rt-commit
mailing list