Index: lib/Parrot/Docs/POD2HTML.pm =================================================================== --- lib/Parrot/Docs/POD2HTML.pm (revision 37607) +++ lib/Parrot/Docs/POD2HTML.pm (working copy) @@ -33,7 +33,24 @@ our $VERSION = '1.0'; use Parrot::Docs::HTMLPage; +use Parrot::Distribution; +=item C + +Extend C method to accept PIR and PASM sections that +contain example code, which will be put into a
 HTML element.
+
+=cut
+
+sub new {
+    my $new = shift->SUPER::new(@_);
+
+    $new->accept_targets('PIR', 'PASM');
+    delete(@{$new->{'Tagmap'}}{'Data','/Data'});
+
+    return $new;
+}
+
 =item C
 
 Reimplements the C method to add a header to the start
@@ -125,6 +142,9 @@
     elsif ( $tagname eq 'Data' ) {
         $self->process_data_start_token($token);
     }
+    elsif ( $tagname eq 'for' ) {
+        $self->process_for_start_token($token);
+    }
     else {
         $self->process_other_start_token($token);
     }
@@ -312,9 +332,31 @@
         return;
     }
 
-    printf { $self->{'output_fh'} } "\n" . $next->text . "\n";
+    if  ($self->{IN_CODE_BLOCK}) {
+        print { $self->{'output_fh'} } $next->text;
+    }
+    else {
+        print { $self->{'output_fh'} } "\n" . $next->text . "\n";
+    }
 }
 
+=item C
+
+Processes a for start token.
+
+=cut
+
+sub process_for_start_token {
+    my $self  = shift;
+    my $token = shift;
+    my $target = $token->attr("target");
+
+    if ($target eq "PIR" || $target eq "PASM") {
+        print { $self->{'output_fh'} } "
";
+        $self->{IN_CODE_BLOCK} = 1;
+    }
+}
+
 =item C
 
 Processes a start token not processable by the above methods.
@@ -368,6 +410,10 @@
     elsif ( $tagname eq 'item-text' ) {
         $self->{IN_ITEM_TEXT} = 0;
     }
+    elsif ( $tagname eq 'for' ) {
+        print { $self->{'output_fh'} } '
' if $self->{IN_CODE_BLOCK}; + $self->{IN_CODE_BLOCK} = 0; + } print { $self->{'output_fh'} } $self->{'Tagmap'}{"/$tagname"} || return;