File Coverage

blib/lib/Perl6/Pod/FormattingCode/C.pm
Criterion Covered Total %
statement 12 36 33.3
branch 0 2 0.0
condition n/a
subroutine 4 8 50.0
pod 0 4 0.0
total 16 50 32.0


line stmt bran cond sub pod time code
1             package Perl6::Pod::FormattingCode::C;
2              
3             =pod
4              
5             =head1 NAME
6              
7             Perl6::Pod::FormattingCode::C - Contained text is code
8              
9             =head1 SYNOPSIS
10              
11             =para
12             Use C<=config> for this or C<< $i > 4 >>;
13              
14             =head1 DESCRIPTION
15              
16             The CE> formatting code specifies that the contained text is code; that is, something that might appear in a program or specification. Such content would typically be rendered in a fixed-width font (preferably a different font from that used for the CE> or CE> formatting codes) or with ... tags. The contents of a CE> code are space-preserved and verbatim. The CE> code is the inline equivalent of the =code block.
17              
18             To include other formatting codes in a CE> code, you can lexically reconfigure it:
19              
20             =begin para
21             =config C<> :allow
22             Perl 6 makes extensive use of the C> and C>
23             characters, for example, in a hash look-up:
24             C<%hashI>keyI>>
25             =end para
26              
27             To enable entities in every C...E> put a =config CE>> :allowCEE> at the top of the document
28              
29             Exported :
30              
31             =over
32              
33             =item * docbook
34              
35            
36              
37             L
38              
39             =item * html
40              
41            
42              
43             L
44              
45             =back
46              
47             =cut
48 3     3   151 use Perl6::Pod::FormattingCode;
  3         7  
  3         76  
49 3     3   15 use base 'Perl6::Pod::FormattingCode';
  3         5  
  3         207  
50 3     3   15 use strict;
  3         6  
  3         55  
51 3     3   13 use warnings;
  3         5  
  3         1090  
52             our $VERSION = '0.01';
53              
54             sub new {
55 0     0 0   my $class = shift;
56 0           my $self = $class->SUPER::new(@_);
57             #parse content
58 0           my $attr = $self->get_attr;
59 0 0         if ( my $allow = $attr->{allow} ) {
60 0           my $fc = Perl6::Pod::Utl::parse_para($self->{content}, allow=>$allow);
61 0           $self->{content} = $fc;
62 0           } else { $self->{content} = [$self->{content}]}
63 0           $self
64             }
65              
66             sub to_xhtml {
67 0     0 0   my ($self, $to ) = @_;
68 0           $to->w->raw('');
69 0           $to->visit_childs($self);
70 0           $to->w->raw('');
71             }
72              
73             sub to_docbook {
74 0     0 0   my $self = shift;
75 0           my $to = shift;
76 0           my $w = $to->w;
77 0           $w->raw(" ");
78 0           $to->visit_childs($self);
79 0           $w->raw('');
80             }
81              
82             sub to_latex {
83 0     0 0   my $self = shift;
84 0           my $to = shift;
85 0           my $w = $to->w;
86 0           $w->raw('\verb=');
87 0           $to->visit_childs($self);
88 0           $w->raw('=');
89              
90             }
91              
92             1;
93             __END__