File Coverage

blib/lib/Perl6/Pod/FormattingCode/N.pm
Criterion Covered Total %
statement 15 26 57.6
branch n/a
condition n/a
subroutine 5 7 71.4
pod 2 2 100.0
total 22 35 62.8


line stmt bran cond sub pod time code
1             package Perl6::Pod::FormattingCode::N;
2              
3             =pod
4              
5             =head1 NAME
6              
7             Perl6::Pod::FormattingCode::N - inline note
8              
9             =head1 SYNOPSIS
10              
11             =begin code :allow
12             Use a C loop instead.B loop is far more
13             powerful than its Perl 5 predecessor.>> Preferably with an explicit
14             iterator variable.
15             =end code
16              
17             =head1 DESCRIPTION
18              
19             Anything enclosed in an CE> code is an inline B.
20             For example:
21              
22             Use a C loop instead.B loop is far more
23             powerful than its Perl 5 predecessor.>> Preferably with an explicit
24             iterator variable.
25              
26             Renderers may render such annotations in a variety of ways: as
27             footnotes, as endnotes, as sidebars, as pop-ups, as tooltips, as
28             expandable tags, etc. They are never, however, rendered as unmarked
29             inline text. So the previous example might be rendered as:
30              
31              
32             Use a for loop instead. [*] Preferably with an explicit iterator
33             variable.
34              
35             and later:
36              
37             Footnotes
38             [*] The Perl 6 for loop is far more powerful than its Perl 5
39             predecessor.
40              
41             =cut
42              
43 3     3   16 use warnings;
  3         8  
  3         82  
44 3     3   14 use strict;
  3         6  
  3         64  
45 3     3   14 use Data::Dumper;
  3         7  
  3         170  
46 3     3   16 use Perl6::Pod::FormattingCode;
  3         7  
  3         65  
47 3     3   15 use base 'Perl6::Pod::FormattingCode';
  3         7  
  3         692  
48             our $VERSION = '0.01';
49              
50             =head2 to_xhtml
51              
52             A footnote reference and footnote text are output to HTML as follows:
53              
54             Footnote reference:
55              
56             [1]
57              
58             Footnote:
59              
60            

NOTES

61            

1

62             Text of footnote ...

63            
64              
65             You can change the formatting of the footnote paragraph using CSS. Use the div.footnote CSS selector, and apply whatever styles you want with it, as shown in the following example.
66              
67             div.footnote {
68             font-size: 8pt;
69             }
70              
71            
72             =cut
73              
74             #FOR REAL processing SEE Perl6::Pod::To::*
75              
76             sub to_xhtml {
77 0     0 1   my ( $self, $to ) = @_;
78 0           my $w = $to->w;
79 0           my $nid = ++$to->{CODE_N_COUNT};
80              
81              
82             #[1]
83 0           $w->raw(qq![$nid]!);
84             #save this element
85 0           push @{ $to->{CODE_N} }, $self;
  0            
86             }
87              
88             =head2 to_docbook
89              
90             This element is a wrapper around the contents of a footnote.
91              
92             Some text
93              
94             L
95              
96             =cut
97              
98             sub to_docbook {
99 0     0 1   my ( $self, $to ) = @_;
100 0           my $w = $to->w;
101 0           $w->raw('');
102 0           $to->visit_childs($self);
103 0           $w->raw('');
104             }
105              
106             1;
107             __END__