Pod-WordML

 view release on metacpan or  search on metacpan

lib/Pod/WordML.pm  view on Meta::CPAN

		elsif( $self->{in_item_list} ) { $self->item_subpara_style }
		else                           { $self->normal_para_style  }
		};

	$self->{'scratch'}  =
qq|  <w:p>
    <w:pPr>
      <w:pStyle w:val="$style" />
    </w:pPr>
    <w:r>
      <w:t>|;

	$self->{'scratch'} .= "\x{25FE} " if $self->{in_item};

	$self->emit;

	$self->{'in_para'} = 1;
	}


sub end_Para
	{
	my $self = shift;

	$self->{'scratch'} .= '</w:t>
    </w:r>
  </w:p>
';

	$self->emit;

	$self->end_non_code_text;

	$self->{'in_para'} = 0;
	}

sub start_figure 	{ }

sub end_figure      { }

sub first_code_line_style  { 'first code line'   }
sub middle_code_line_style { 'middle code line'  }
sub last_code_line_style   { 'last code line'    }

sub first_code_line  { $_[0]->make_para( $_[0]->first_code_line_style,  $_[1] ) }
sub middle_code_line { $_[0]->make_para( $_[0]->middle_code_line_style, $_[1] ) }
sub last_code_line   { $_[0]->make_para( $_[0]->last_code_line_style,   $_[1] ) }

sub start_Verbatim
	{
	$_[0]{'in_verbatim'} = 1;
	}

sub end_Verbatim
	{
	my $self = shift;

	# get rid of all but one trailing newline
	$self->{'scratch'} =~ s/\s+\z//;

	chomp( my @lines = split m/^/m, $self->{'scratch'} );
	$self->{'scratch'} = '';

	@lines = map { s/</&lt;/g; $_ } @lines;

	if( @lines == 1 )
		{
		$self->make_para( $self->single_code_line_style, @lines );
		}
	elsif( @lines )
		{
		my $first = shift @lines;
		my $last  = pop   @lines;

		$self->first_code_line( $first );

		foreach my $line ( @lines )
			{
			$self->middle_code_line( $line );
			}

		$self->last_code_line( $last );
		}

	$self->{'in_verbatim'} = 0;
	}

sub _get_initial_item_type
	{
	my $self = shift;

	my $type = $self->SUPER::_get_initial_item_type;

	#print STDERR "My item type is [$type]\n";

	$type;
	}

=pod

  <w:p wsp:rsidR="00FE5092" wsp:rsidRDefault="00FE5092" wsp:rsidP="00FE5092">
    <w:pPr>
      <w:pStyle w:val="ListBullet" />
      <w:listPr>
        <wx:t wx:val="·" />
        <wx:font wx:val="Symbol" />
      </w:listPr>
    </w:pPr>
    <w:r>
      <w:t>List item 1</w:t>
    </w:r>
  </w:p>

=cut

sub not_implemented { croak "Not implemented!" }

sub bullet_item_style { 'bullet item' }
sub start_item_bullet
	{
	my( $self ) = @_;



( run in 1.548 second using v1.01-cache-2.11-cpan-71847e10f99 )