[Rt-commit] rt branch, 4.0/extension-docs, created. rt-4.0.13-90-g39faa0e
Thomas Sibley
trs at bestpractical.com
Fri Jun 21 20:40:38 EDT 2013
The branch, 4.0/extension-docs has been created
at 39faa0ed8f452214b23319b20457b0e9900a5bb6 (commit)
- Log -----------------------------------------------------------------
commit 4a166dfae8f1eb78d07ff962f7c9ba3f71cef4e3
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Jun 21 13:19:44 2013 -0700
rt-static-docs: Rename --rt to --source
In preparation for processing docs in RT extensions.
diff --git a/devel/tools/rt-static-docs b/devel/tools/rt-static-docs
index 30d422d..62aa00e 100755
--- a/devel/tools/rt-static-docs
+++ b/devel/tools/rt-static-docs
@@ -61,7 +61,7 @@ my %opts;
GetOptions(
\%opts,
"help|h",
- "rt=s",
+ "source=s",
"to=s",
);
@@ -80,13 +80,13 @@ die "--to MUST be a directory\n" unless -d $opts{to};
# Unpack the tarball, if that's what we're given.
my $tmpdir;
-if (($opts{rt} || '') =~ /\.tar\.gz$/ and -f $opts{rt}) {
+if (($opts{source} || '') =~ /\.tar\.gz$/ and -f $opts{source}) {
$tmpdir = File::Temp->newdir();
- system("tar", "xzpf", $opts{rt}, "-C", $tmpdir);
- $opts{rt} = <$tmpdir/rt-*>;
+ system("tar", "xzpf", $opts{source}, "-C", $tmpdir);
+ $opts{source} = <$tmpdir/rt-*>;
}
-chdir $opts{rt} if $opts{rt};
+chdir $opts{source} if $opts{source};
my @dirs = (
qw(
@@ -187,7 +187,7 @@ rt-static-docs - generate doc shipped with RT
=head1 SYNOPSIS
- rt-static-docs --to /path/to/output [--rt /path/to/rt]
+ rt-static-docs --to /path/to/output [--source /path/to/rt]
=head1 DESCRIPTION
@@ -207,7 +207,7 @@ L<http://bestpractical.com/rt/docs/>.
Set the destination directory for the output files.
-=item --rt
+=item --source
Set the RT base directory to search under. Defaults to the current working
directory, which is fine if you're running this script as
commit d835cdbd1a2906056cb7391162295e49ce31ed74
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Jun 21 15:48:46 2013 -0700
Save what our POD search found and use that info when making local links
If we find a link to an RT resource but didn't find the referenced name
in the POD search, then assume we're documenting an extension and link
one level up into rt/. This allows links in extensions which point to
core documentation.
diff --git a/lib/RT/Pod/HTML.pm b/lib/RT/Pod/HTML.pm
index d220509..6613f47 100644
--- a/lib/RT/Pod/HTML.pm
+++ b/lib/RT/Pod/HTML.pm
@@ -54,6 +54,10 @@ use base 'Pod::Simple::XHTML';
use HTML::Entities qw//;
+__PACKAGE__->_accessorize(
+ "batch"
+);
+
sub new {
my $self = shift->SUPER::new(@_);
$self->index(1);
@@ -118,6 +122,8 @@ sub resolve_local_link {
my $self = shift;
my ($name, $section) = @_;
+ $name .= ""; # stringify name, it may be an object
+
$section = defined $section
? '#' . $self->idify($section, 1)
: '';
@@ -132,6 +138,7 @@ sub resolve_local_link {
$local = $self->encode_entities($name);
}
elsif ($name eq "RT_Config" or $name eq "RT_Config.pm") {
+ $name = "RT_Config";
$local = "RT_Config";
}
# These matches handle links that look like filenames, such as those we
@@ -139,6 +146,7 @@ sub resolve_local_link {
elsif ( $name =~ m{^(?:lib/)(RT/[\w/]+?)\.pm$}
or $name =~ m{^(?:docs/)(.+?)\.pod$})
{
+ $name = join "::", split '/', $1;
$local = join "/",
map { $self->encode_entities($_) }
split /\//, $1;
@@ -146,11 +154,20 @@ sub resolve_local_link {
if ($local) {
# Resolve links correctly by going up
- my $depth = $self->batch_mode_current_level - 1;
- return ($depth ? "../" x $depth : "") . "$local.html$section";
+ my $found = $self->batch->found($name);
+ my $depth = $self->batch_mode_current_level;
+ $depth-- if $found;
+ return ($depth ? "../" x $depth : "") . ($found ? "" : "rt/") . "$local.html$section";
} else {
return;
}
}
+sub batch_mode_page_object_init {
+ my ($self, $batch, $module, $infile, $outfile, $depth) = @_;
+ $self->SUPER::batch_mode_page_object_init(@_[1..$#_]);
+ $self->batch( $batch );
+ return $self;
+}
+
1;
diff --git a/lib/RT/Pod/HTMLBatch.pm b/lib/RT/Pod/HTMLBatch.pm
index f41a43a..a5c3785 100644
--- a/lib/RT/Pod/HTMLBatch.pm
+++ b/lib/RT/Pod/HTMLBatch.pm
@@ -57,6 +57,8 @@ use List::MoreUtils qw/all/;
use RT::Pod::Search;
use RT::Pod::HTML;
+my $MOD2PATH;
+
sub new {
my $self = shift->SUPER::new(@_);
$self->verbose(0);
@@ -176,4 +178,15 @@ sub esc {
Pod::Simple::HTMLBatch::esc(@_);
}
+sub find_all_pods {
+ my $self = shift;
+ $MOD2PATH = $self->SUPER::find_all_pods(@_);
+ return $MOD2PATH;
+}
+
+sub found {
+ my ($self, $module) = @_;
+ return(exists $MOD2PATH->{$module} and defined $MOD2PATH->{$module});
+}
+
1;
commit 214e3f6916ec1c6f422a697fb7225a5def398d7d
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Jun 21 16:04:17 2013 -0700
Fix two POD linking errors uncovered by the new stricter local linking
diff --git a/docs/initialdata.pod b/docs/initialdata.pod
index 6445fb0..c649b62 100644
--- a/docs/initialdata.pod
+++ b/docs/initialdata.pod
@@ -90,7 +90,7 @@ the admin interface. B<Do not> omit the C<< Domain => 'UserDefined' >> line.
Additionally, the C<MemberOf> field is specially handled to make it easier to
add the new group to other groups. C<MemberOf> may be a single value or an
array ref. Each value should be a user-defined group name or hashref to pass
-into L<< RT::Group->LoadByCols >>. Each group found will have the new group
+into L<RT::Group/LoadByCols>. Each group found will have the new group
added as a member.
Unfortunately you can't specify the I<members> of a group at this time. As a
diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index ab0f307..1d99cda 100644
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -382,7 +382,7 @@ sub AddAttachments {
=head2 AddAttachment $attachment
-Takes one attachment object of L<RT::Attachmment> class and attaches it to the message
+Takes one attachment object of L<RT::Attachment> class and attaches it to the message
we're building.
=cut
commit 4d75201266e1343cc83ab629c35045dd4f6094c9
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Jun 21 16:12:47 2013 -0700
Document RT::CustomFieldValues::Groups so links resolve correctly to it
diff --git a/lib/RT/CustomFieldValues/Groups.pm b/lib/RT/CustomFieldValues/Groups.pm
index feeeadb..34722bb 100644
--- a/lib/RT/CustomFieldValues/Groups.pm
+++ b/lib/RT/CustomFieldValues/Groups.pm
@@ -53,10 +53,42 @@ use warnings;
use base qw(RT::CustomFieldValues::External);
+=head1 NAME
+
+RT::CustomFieldValues::Groups - Provide RT's groups as a dynamic list of CF values
+
+=head1 SYNOPSIS
+
+To use as a source of CF values, add the following to your F<RT_SiteConfig.pm>
+and restart RT.
+
+ # In RT_SiteConfig.pm
+ Set( @CustomFieldValuesSources, "RT::CustomFieldValues::Groups" );
+
+Then visit the modify CF page in the RT admin configuration.
+
+=head1 METHODS
+
+Most methods are inherited from L<RT::CustomFieldValues::External>, except the
+ones below.
+
+=head2 SourceDescription
+
+Returns a brief string describing this data source.
+
+=cut
+
sub SourceDescription {
return 'RT user defined groups';
}
+=head2 ExternalValues
+
+Returns an arrayref containing a hashref for each possible value in this data
+source, where the value name is the group name.
+
+=cut
+
sub ExternalValues {
my $self = shift;
commit db22c9cd7db015d690d44574975d39368c092573
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Jun 21 16:13:45 2013 -0700
Link the latest core RT docs from non-core docs
diff --git a/lib/RT/Pod/HTML.pm b/lib/RT/Pod/HTML.pm
index 6613f47..6f4d295 100644
--- a/lib/RT/Pod/HTML.pm
+++ b/lib/RT/Pod/HTML.pm
@@ -157,7 +157,7 @@ sub resolve_local_link {
my $found = $self->batch->found($name);
my $depth = $self->batch_mode_current_level;
$depth-- if $found;
- return ($depth ? "../" x $depth : "") . ($found ? "" : "rt/") . "$local.html$section";
+ return ($depth ? "../" x $depth : "") . ($found ? "" : "rt/latest/") . "$local.html$section";
} else {
return;
}
commit e51a1bc6f5b488bc3b0ee94912e155d99ac06d6e
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Jun 21 17:38:50 2013 -0700
rt-static-docs: Add an --extension flag which doesn't do much (yet)
Currently it just suppresses a warning about not finding ./configure.
diff --git a/devel/tools/rt-static-docs b/devel/tools/rt-static-docs
index 62aa00e..300ef39 100755
--- a/devel/tools/rt-static-docs
+++ b/devel/tools/rt-static-docs
@@ -63,6 +63,7 @@ GetOptions(
"help|h",
"source=s",
"to=s",
+ "extension=s",
);
if ( $opts{'help'} ) {
@@ -130,7 +131,8 @@ elsif (-x "configure") {
generate_configure_help("configure");
}
else {
- warn "Unable to generate a page for ./configure --help!\n";
+ warn "Unable to generate a page for ./configure --help!\n"
+ unless $opts{extension};
}
# Manually "convert" README* and 3.8-era UPGRADING* to HTML and push them into
commit 39faa0ed8f452214b23319b20457b0e9900a5bb6
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Jun 21 17:39:10 2013 -0700
If we didn't find a local link in the current source, it needs to link even higher up the tree
This accounts for the version component of the docs tree.
diff --git a/lib/RT/Pod/HTML.pm b/lib/RT/Pod/HTML.pm
index 6f4d295..55abe2d 100644
--- a/lib/RT/Pod/HTML.pm
+++ b/lib/RT/Pod/HTML.pm
@@ -155,8 +155,8 @@ sub resolve_local_link {
if ($local) {
# Resolve links correctly by going up
my $found = $self->batch->found($name);
- my $depth = $self->batch_mode_current_level;
- $depth-- if $found;
+ my $depth = $self->batch_mode_current_level
+ + ($found ? -1 : 1);
return ($depth ? "../" x $depth : "") . ($found ? "" : "rt/latest/") . "$local.html$section";
} else {
return;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list