Permalink
Browse files

add SeeAlsoMason

  • Loading branch information...
1 parent 606a02a commit 5cfddcadb54dc56eb1a1d8bf30760afc2ffc0a4c @jonswar committed Jul 12, 2012
Showing with 39 additions and 1 deletion.
  1. +38 −0 lib/Pod/Weaver/Section/SeeAlsoMason.pm
  2. +1 −1 weaver.ini
@@ -0,0 +1,38 @@
+package Pod::Weaver::Section::SeeAlsoMason;
+use Moose;
+with 'Pod::Weaver::Role::Section';
+
+use Moose::Autobox;
+
+# Add "SEE ALSO: Mason"
+
+sub weave_section {
+ my ( $self, $document, $input ) = @_;
+
+ my $idc = $input->{pod_document}->children;
+ for ( my $i = 0 ; $i < $idc->length ; $i++ ) {
+ next unless my $para = $idc->[$i];
+ return
+ if $para->can('command')
+ && $para->command eq 'head1'
+ && $para->content eq 'SEE ALSO';
+ }
+ $document->children->push(
+ Pod::Elemental::Element::Nested->new(
+ {
+ command => 'head1',
+ content => 'SEE ALSO',
+ children => [
+ Pod::Elemental::Element::Pod5::Ordinary->new(
+ { content => "L<Mason|Mason>" }
+ ),
+ ],
+ }
+ ),
+ );
+}
+
+__PACKAGE__->meta->make_immutable;
+
+no Moose;
+1;
View
@@ -4,6 +4,6 @@
[Generic / SYNOPSIS]
[Generic / DESCRIPTION]
[Leftovers]
-[SeeAlsoCHI]
+[SeeAlsoMason]
[Authors]
[Legal]

0 comments on commit 5cfddca

Please sign in to comment.