line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#=============================================================================== |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# DESCRIPTION: Make presentations |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# AUTHOR: Aliaksandr P. Zahatski, |
6
|
|
|
|
|
|
|
#=============================================================================== |
7
|
|
|
|
|
|
|
package Perl6::Pod::Slide::Writer; |
8
|
1
|
|
|
1
|
|
4989
|
use Perl6::Pod::Writer; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use base 'Perl6::Pod::Writer'; |
10
|
|
|
|
|
|
|
use strict; |
11
|
|
|
|
|
|
|
use warnings; |
12
|
|
|
|
|
|
|
sub print { |
13
|
|
|
|
|
|
|
my $self = shift; |
14
|
|
|
|
|
|
|
my $fh = $self->o; |
15
|
|
|
|
|
|
|
# if (my $type = $self->{escape}) { |
16
|
|
|
|
|
|
|
# my $str = join ""=>@_; |
17
|
|
|
|
|
|
|
# print $fh ($type eq 'xml') ? _xml_escape($str) : _html_escape($str); |
18
|
|
|
|
|
|
|
# return $self |
19
|
|
|
|
|
|
|
# } |
20
|
|
|
|
|
|
|
print $fh @_; |
21
|
|
|
|
|
|
|
$self |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
sub start_nesting { |
24
|
|
|
|
|
|
|
my $self = shift; |
25
|
|
|
|
|
|
|
my $level = shift || 1 ; |
26
|
|
|
|
|
|
|
$self->raw('') for (1..$level); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
sub stop_nesting { |
29
|
|
|
|
|
|
|
my $self = shift; |
30
|
|
|
|
|
|
|
my $level = shift || 1 ; |
31
|
|
|
|
|
|
|
$self->raw('') for (1..$level); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
package Perl6::Pod::Slide; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Perl6::Pod::Slide - make slides easy |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Create Perl6 Pod file: |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=for DESCRIPTION :title('Perl6 Pod:How it made') |
45
|
|
|
|
|
|
|
= :author('Aliaksandr Zahatski') :pubdate('2 jul 2010') |
46
|
|
|
|
|
|
|
=config Image :width('2in') |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=begin Slide |
49
|
|
|
|
|
|
|
Using B<:pause> attribute |
50
|
|
|
|
|
|
|
=for item :numbered |
51
|
|
|
|
|
|
|
Item1 |
52
|
|
|
|
|
|
|
=for item :numbered :pause |
53
|
|
|
|
|
|
|
Item2 |
54
|
|
|
|
|
|
|
=for item :numbered |
55
|
|
|
|
|
|
|
Item3 |
56
|
|
|
|
|
|
|
=end Slide |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Convert pod file to tex: |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
pod6slide < tech_docs.pod > tech_docs.tex |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
To pdf: |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
pdflatex tech_docs.tex |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Example for add image: |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=begin Slide :title('Test code') |
70
|
|
|
|
|
|
|
Flexowriter |
71
|
|
|
|
|
|
|
=for Image :width('2.5in') |
72
|
|
|
|
|
|
|
img/pdp1_a.jpg |
73
|
|
|
|
|
|
|
=end Slide |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Example for programm code listing: |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=begin code :lang('Perl') |
78
|
|
|
|
|
|
|
sub print_export { |
79
|
|
|
|
|
|
|
my $self = shift; |
80
|
|
|
|
|
|
|
push @_, "\n"; |
81
|
|
|
|
|
|
|
return $self->SUPER::print_export(@_); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
=end code |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
or some other languages : C,C,C,C,C, |
86
|
|
|
|
|
|
|
C,C,C,C,C,C, C ... |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 DESCRIPTION |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Perl6::Pod::Slide - make slides easy |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 METHODS |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
use Perl6::Pod::To::Latex; |
96
|
|
|
|
|
|
|
use base 'Perl6::Pod::To::Latex'; |
97
|
|
|
|
|
|
|
use Perl6::Pod::Utl; |
98
|
|
|
|
|
|
|
use strict; |
99
|
|
|
|
|
|
|
use warnings; |
100
|
|
|
|
|
|
|
use Data::Dumper; |
101
|
|
|
|
|
|
|
use File::Temp qw/ tempfile /; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
$Perl6::Pod::Slide::VERSION = '0.10'; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub new { |
106
|
|
|
|
|
|
|
my $class = shift; |
107
|
|
|
|
|
|
|
my %args = @_; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my $writer = new Perl6::Pod::Slide::Writer:: |
110
|
|
|
|
|
|
|
out => ( $args{out} || \*STDOUT ); |
111
|
|
|
|
|
|
|
return $class->SUPER::new(@_,writer=>$writer, format=>'latex') |
112
|
|
|
|
|
|
|
# return $class->SUPER::new(@_, writer) |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
sub start_write { |
115
|
|
|
|
|
|
|
my $self = shift; |
116
|
|
|
|
|
|
|
$self->w->raw(<<'HEAD') if $self->{headers}; |
117
|
|
|
|
|
|
|
% maked by p5-Perl6-Pod-Slide |
118
|
|
|
|
|
|
|
% |
119
|
|
|
|
|
|
|
\documentclass{beamer} |
120
|
|
|
|
|
|
|
\useinnertheme{rectangles} |
121
|
|
|
|
|
|
|
\setbeamercolor{rectangles}{bg=violet!12,fg=black} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
\usetheme{default} |
124
|
|
|
|
|
|
|
\setbeamertemplate{blocks}[rounded][shadow=true] |
125
|
|
|
|
|
|
|
\useoutertheme[footline=authortitle]{miniframes} |
126
|
|
|
|
|
|
|
\usetheme[height=7mm]{Rochester} |
127
|
|
|
|
|
|
|
%\useoutertheme{umbcfootline} |
128
|
|
|
|
|
|
|
\usepackage{listings} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
\usepackage[T2A]{fontenc} |
131
|
|
|
|
|
|
|
\usepackage[utf8]{inputenc} |
132
|
|
|
|
|
|
|
\setbeamertemplate{items}[ball] |
133
|
|
|
|
|
|
|
\setbeamertemplate{navigation symbols}{} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
% insert for eps |
136
|
|
|
|
|
|
|
\ifx\pdftexversion\undefined |
137
|
|
|
|
|
|
|
\usepackage[dvips]{graphicx} |
138
|
|
|
|
|
|
|
\else |
139
|
|
|
|
|
|
|
\usepackage{graphicx} |
140
|
|
|
|
|
|
|
\DeclareGraphicsRule{*}{mps}{*}{} |
141
|
|
|
|
|
|
|
\fi |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
\lstdefinelanguage{JavaScript}{ |
144
|
|
|
|
|
|
|
keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break}, |
145
|
|
|
|
|
|
|
keywordstyle=\color{blue}\bfseries, |
146
|
|
|
|
|
|
|
ndkeywords={class, export, boolean, throw, implements, import, this}, |
147
|
|
|
|
|
|
|
ndkeywordstyle=\color{darkgray}\bfseries, |
148
|
|
|
|
|
|
|
identifierstyle=\color{black}, |
149
|
|
|
|
|
|
|
sensitive=false, |
150
|
|
|
|
|
|
|
comment=[l]{//}, |
151
|
|
|
|
|
|
|
morecomment=[s]{/*}{*/}, |
152
|
|
|
|
|
|
|
commentstyle=\color{purple}\ttfamily, |
153
|
|
|
|
|
|
|
stringstyle=\color{red}\ttfamily, |
154
|
|
|
|
|
|
|
morestring=[b]', |
155
|
|
|
|
|
|
|
morestring=[b]" |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
% Permet l'ajout de code par insertion du fichier le contenant |
159
|
|
|
|
|
|
|
% Coloration + ajout titre |
160
|
|
|
|
|
|
|
% Les arguments sont : |
161
|
|
|
|
|
|
|
% $1 : titre associИ Ю l'extrait de code |
162
|
|
|
|
|
|
|
% $2 : nom du fichier Ю inclure |
163
|
|
|
|
|
|
|
% $3 : le type de langage (C++, C, Java ...) |
164
|
|
|
|
|
|
|
\newcommand{\addCode}[2]{% |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
% Configuration de la coloration syntaxique du code |
167
|
|
|
|
|
|
|
\definecolor{colKeys}{rgb}{0,0,1} |
168
|
|
|
|
|
|
|
\definecolor{colIdentifier}{rgb}{0,0,0} |
169
|
|
|
|
|
|
|
\definecolor{colComments}{rgb}{0,0.5,1} |
170
|
|
|
|
|
|
|
\definecolor{colString}{rgb}{0.6,0.1,0.1} |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
% Configuration des options |
173
|
|
|
|
|
|
|
\lstset{% |
174
|
|
|
|
|
|
|
language = #2,% |
175
|
|
|
|
|
|
|
identifierstyle=\color{colIdentifier},% |
176
|
|
|
|
|
|
|
basicstyle=\ttfamily\scriptsize, % |
177
|
|
|
|
|
|
|
keywordstyle=\color{colKeys},% |
178
|
|
|
|
|
|
|
stringstyle=\color{colString},% |
179
|
|
|
|
|
|
|
commentstyle=\color{colComments},% |
180
|
|
|
|
|
|
|
columns = flexible,% |
181
|
|
|
|
|
|
|
%tabsize = 8,% |
182
|
|
|
|
|
|
|
showspaces = false,% |
183
|
|
|
|
|
|
|
numbers = left, numberstyle=\tiny,% |
184
|
|
|
|
|
|
|
frame = single,frameround=tttt,% |
185
|
|
|
|
|
|
|
breaklines = true, breakautoindent = true,% |
186
|
|
|
|
|
|
|
captionpos = b,% |
187
|
|
|
|
|
|
|
xrightmargin=10mm, xleftmargin = 15mm, framexleftmargin = 7mm,% |
188
|
|
|
|
|
|
|
}% |
189
|
|
|
|
|
|
|
\begin{center} |
190
|
|
|
|
|
|
|
\lstinputlisting{#1} |
191
|
|
|
|
|
|
|
\end{center} |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
HEAD |
195
|
|
|
|
|
|
|
} |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub block_Pause { |
199
|
|
|
|
|
|
|
my $self = shift; |
200
|
|
|
|
|
|
|
$self->w->say('\pause'); |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
sub block_Latex { |
204
|
|
|
|
|
|
|
my $self = shift; |
205
|
|
|
|
|
|
|
my $el = shift; |
206
|
|
|
|
|
|
|
$self->w->say($el->childs->[0]); |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
sub block_code { |
210
|
|
|
|
|
|
|
my $self =shift; |
211
|
|
|
|
|
|
|
my $el = shift; |
212
|
|
|
|
|
|
|
# =for code :lang('Perl') |
213
|
|
|
|
|
|
|
# convert to |
214
|
|
|
|
|
|
|
#\addCode{ TMP_FILE }{Perl} |
215
|
|
|
|
|
|
|
my $pod_attr = $el->get_attr; |
216
|
|
|
|
|
|
|
my $w = $self->writer; |
217
|
|
|
|
|
|
|
if (my $lang = $pod_attr->{lang} ) { |
218
|
|
|
|
|
|
|
#make temporary file |
219
|
|
|
|
|
|
|
my ( $fh, $filename ) = tempfile(TEMPLATE => 'slidesXXXXX', |
220
|
|
|
|
|
|
|
SUFFIX => '.tmp'); |
221
|
|
|
|
|
|
|
binmode( $fh, ":utf8" ); |
222
|
|
|
|
|
|
|
print $fh $el->childs->[0]; |
223
|
|
|
|
|
|
|
$w->raw("\n\\addCode{ $filename }{$lang} "); |
224
|
|
|
|
|
|
|
return |
225
|
|
|
|
|
|
|
} |
226
|
|
|
|
|
|
|
if ( my $allow = $el->get_attr->{allow} ) { |
227
|
|
|
|
|
|
|
$el->{content} = |
228
|
|
|
|
|
|
|
Perl6::Pod::Utl::parse_para( $el->childs->[0], allow => $allow ); |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
$w->say('\begin{verbatim}'); |
231
|
|
|
|
|
|
|
$self->visit_childs($el); |
232
|
|
|
|
|
|
|
$w->say('\end{verbatim}'); |
233
|
|
|
|
|
|
|
} |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=head2 block_Slide |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=begin Slide :title('Asd') |
238
|
|
|
|
|
|
|
= :backimage('img/297823712_f8e59447a5_z.jpg') |
239
|
|
|
|
|
|
|
= :valign(t) :valign(c) :valign(b) |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=cut |
242
|
|
|
|
|
|
|
sub block_Slide { |
243
|
|
|
|
|
|
|
my $self = shift; |
244
|
|
|
|
|
|
|
my $el = shift; |
245
|
|
|
|
|
|
|
my $w = $self->writer; |
246
|
|
|
|
|
|
|
my $pod_attr = $el->get_attr; |
247
|
|
|
|
|
|
|
#fill backimage |
248
|
|
|
|
|
|
|
#http://tex.stackexchange.com/questions/7916/ |
249
|
|
|
|
|
|
|
my $if_enclosed = 0; |
250
|
|
|
|
|
|
|
if ( my $backimage = $pod_attr->{backimage} ){ |
251
|
|
|
|
|
|
|
$if_enclosed = 1; |
252
|
|
|
|
|
|
|
$w->say('{'); |
253
|
|
|
|
|
|
|
# $w->say('\usebackgroundtemplate{\includegraphics[width=\paperwidth]{' |
254
|
|
|
|
|
|
|
# .$backimage.'}}'); |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
$w->say('\usebackgroundtemplate{ |
257
|
|
|
|
|
|
|
\vbox to \paperheight{\vfil\hbox to \paperwidth{\hfil\includegraphics[width=\paperwidth]{'.$backimage.'}\hfil}\vfil}}'); |
258
|
|
|
|
|
|
|
} |
259
|
|
|
|
|
|
|
if (my $valign = $pod_attr->{valign}) { |
260
|
|
|
|
|
|
|
$w->say("\\begin{frame}[$valign]"); |
261
|
|
|
|
|
|
|
} else { |
262
|
|
|
|
|
|
|
$w->say("\\begin{frame}[fragile]"); |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
if ( my $title = $pod_attr->{title} ) { |
265
|
|
|
|
|
|
|
$title = join "" => @$title if ref($title); |
266
|
|
|
|
|
|
|
$w->say("\\frametitle{$title}"); |
267
|
|
|
|
|
|
|
} |
268
|
|
|
|
|
|
|
# warn "====Start parse" . $el->childs->[0]; |
269
|
|
|
|
|
|
|
# use Data::Dumper;die Dumper (Perl6::Pod::Utl::parse_pod($el->childs->[0], default_pod=>1)) if $el->childs->[0] =~/asdasdasdasd/; |
270
|
|
|
|
|
|
|
$self->visit(Perl6::Pod::Utl::parse_pod($el->childs->[0], default_pod=>1)); |
271
|
|
|
|
|
|
|
$w->say("\\end{frame}"); |
272
|
|
|
|
|
|
|
if ($if_enclosed) { |
273
|
|
|
|
|
|
|
$w->say('}'); |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
=head2 Image |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
\begin{figure}[h] |
280
|
|
|
|
|
|
|
\begin{center} |
281
|
|
|
|
|
|
|
\includegraphics[height=5cm,width=90mm]{leaves.jpg} |
282
|
|
|
|
|
|
|
\end{center} |
283
|
|
|
|
|
|
|
\caption{Caption of the image} |
284
|
|
|
|
|
|
|
\label{leave} |
285
|
|
|
|
|
|
|
\end{figure} |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
=cut |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
sub block_Image { |
291
|
|
|
|
|
|
|
my $self = shift; |
292
|
|
|
|
|
|
|
my $el = shift; |
293
|
|
|
|
|
|
|
my $pod_attr = $el->get_attr; |
294
|
|
|
|
|
|
|
my @size_attr = (); |
295
|
|
|
|
|
|
|
if ( my $height = $pod_attr->{height} ) { |
296
|
|
|
|
|
|
|
push @size_attr, "height=$height"; |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
if ( my $width = $pod_attr->{width} ) { |
299
|
|
|
|
|
|
|
push @size_attr, "width=$width"; |
300
|
|
|
|
|
|
|
} |
301
|
|
|
|
|
|
|
my $iattr = ""; |
302
|
|
|
|
|
|
|
if (@size_attr) { |
303
|
|
|
|
|
|
|
$iattr = "[" . join( "=", @size_attr ) . "]"; |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
#add $caption; |
306
|
|
|
|
|
|
|
my $ititle=""; |
307
|
|
|
|
|
|
|
if ( my $title = $pod_attr->{title} ) { |
308
|
|
|
|
|
|
|
$ititle='\caption{'.$title.'}' |
309
|
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
my $image = $el->childs->[0]; |
311
|
|
|
|
|
|
|
chomp $image; |
312
|
|
|
|
|
|
|
$self->w->raw(' |
313
|
|
|
|
|
|
|
\begin{figure}[!ht] |
314
|
|
|
|
|
|
|
\begin{center} |
315
|
|
|
|
|
|
|
\includegraphics' . $iattr . '{' . ${image} . '} |
316
|
|
|
|
|
|
|
\end{center}'.$ititle.' |
317
|
|
|
|
|
|
|
\label{leave} |
318
|
|
|
|
|
|
|
\end{figure} |
319
|
|
|
|
|
|
|
'); |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
} |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
sub code_B { |
325
|
|
|
|
|
|
|
my $self = shift; |
326
|
|
|
|
|
|
|
my $el = shift; |
327
|
|
|
|
|
|
|
$self->w->raw("\\textbf{"); |
328
|
|
|
|
|
|
|
$self->visit_childs($el); |
329
|
|
|
|
|
|
|
$self->w->raw("}"); |
330
|
|
|
|
|
|
|
} |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
sub code_I { |
333
|
|
|
|
|
|
|
my $self = shift; |
334
|
|
|
|
|
|
|
my $el = shift; |
335
|
|
|
|
|
|
|
$self->w->raw("\\emph{"); |
336
|
|
|
|
|
|
|
$self->visit_childs($el); |
337
|
|
|
|
|
|
|
$self->w->raw("}"); |
338
|
|
|
|
|
|
|
} |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
sub block_DESCRIPTION { |
341
|
|
|
|
|
|
|
my $self = shift; |
342
|
|
|
|
|
|
|
my $el = shift; |
343
|
|
|
|
|
|
|
my $w = $self->w; |
344
|
|
|
|
|
|
|
my $pod_attr = $el->get_attr; |
345
|
|
|
|
|
|
|
my $title = $pod_attr->{title}; |
346
|
|
|
|
|
|
|
if ( ref($title) ) { |
347
|
|
|
|
|
|
|
$title = join "" => @$title; |
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
$w->say( "\\title{$title}" ); |
350
|
|
|
|
|
|
|
my $author_txt = |
351
|
|
|
|
|
|
|
exists $pod_attr->{author} |
352
|
|
|
|
|
|
|
? $pod_attr->{author} |
353
|
|
|
|
|
|
|
: "Unknown author. Use :author('My name')"; |
354
|
|
|
|
|
|
|
$w->say("\\author{$author_txt}"); |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
my $pubdate = |
357
|
|
|
|
|
|
|
exists $pod_attr->{pubdate} |
358
|
|
|
|
|
|
|
? $pod_attr->{pubdate} |
359
|
|
|
|
|
|
|
: '\today'; |
360
|
|
|
|
|
|
|
$w->say("\\date{$pubdate}"); |
361
|
|
|
|
|
|
|
} |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=head2 |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=for para :bg :color |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
=cut |
369
|
|
|
|
|
|
|
sub block_para { |
370
|
|
|
|
|
|
|
my ( $self, $el ) = @_; |
371
|
|
|
|
|
|
|
my $attr = $el->get_attr; |
372
|
|
|
|
|
|
|
my $to_close = 0; |
373
|
|
|
|
|
|
|
if (my $bgcolor = $attr->{bg}) { |
374
|
|
|
|
|
|
|
++$to_close; |
375
|
|
|
|
|
|
|
$self->w->say('\colorbox{'.$bgcolor.'} {') |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
if (my $txtcolor = $attr->{color}) { |
378
|
|
|
|
|
|
|
++$to_close; |
379
|
|
|
|
|
|
|
$self->w->say('\textcolor{'.$txtcolor.'} {') |
380
|
|
|
|
|
|
|
} |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
$self->visit(Perl6::Pod::Utl::parse_para($el->childs->[0]) ); |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
if ($to_close) { |
385
|
|
|
|
|
|
|
$self->w->say('}') for (1..$to_close); |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
$self->w->say(''); |
388
|
|
|
|
|
|
|
} |
389
|
|
|
|
|
|
|
=head2 Items |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
For make puse after item add B attribute |
392
|
|
|
|
|
|
|
=for item :numbered :pause |
393
|
|
|
|
|
|
|
One |
394
|
|
|
|
|
|
|
=for item :numbered :pause |
395
|
|
|
|
|
|
|
Two |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=cut |
398
|
|
|
|
|
|
|
sub block_defn { |
399
|
|
|
|
|
|
|
my $self = shift; |
400
|
|
|
|
|
|
|
$self->block_item(@_); |
401
|
|
|
|
|
|
|
} |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
sub block_item { |
404
|
|
|
|
|
|
|
my ( $self, $el, $prev, $next ) = @_; |
405
|
|
|
|
|
|
|
my $w = $self->w; |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
my ( $list_name, $items_name ) = @{ |
408
|
|
|
|
|
|
|
{ |
409
|
|
|
|
|
|
|
ordered => [ 'enumerate', 'item' ], |
410
|
|
|
|
|
|
|
unordered => [ 'itemize', 'item' ], |
411
|
|
|
|
|
|
|
definition => [ 'description', 'item' ] |
412
|
|
|
|
|
|
|
}->{ $el->item_type } |
413
|
|
|
|
|
|
|
}; |
414
|
|
|
|
|
|
|
if (!$prev || $el->get_item_sign($prev) ne $el->get_item_sign($el) ) { |
415
|
|
|
|
|
|
|
#nesting first (only 2> ) |
416
|
|
|
|
|
|
|
unless (exists $el->get_attr->{nested}) { |
417
|
|
|
|
|
|
|
my $tonest = $el->item_level - 1 ; |
418
|
|
|
|
|
|
|
$w->start_nesting( $tonest ) if $tonest; |
419
|
|
|
|
|
|
|
} |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
$w->say('\begin{' . $list_name . '}'); |
422
|
|
|
|
|
|
|
} |
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
$w->raw('\item'); |
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
if ( $el->item_type eq 'definition' ) { |
427
|
|
|
|
|
|
|
$w->raw('['); |
428
|
|
|
|
|
|
|
$self->visit( Perl6::Pod::Utl::parse_para( $el->{term} ) ); |
429
|
|
|
|
|
|
|
$w->raw(']') |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
} |
432
|
|
|
|
|
|
|
$w->raw(' ');#space |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
#parse first para |
435
|
|
|
|
|
|
|
$el->{content}->[0] = |
436
|
|
|
|
|
|
|
Perl6::Pod::Utl::parse_para( $el->{content}->[0] ); |
437
|
|
|
|
|
|
|
$self->visit_childs($el); |
438
|
|
|
|
|
|
|
if ( $el->get_attr->{pause} ) { |
439
|
|
|
|
|
|
|
$w->say('\pause'); |
440
|
|
|
|
|
|
|
} |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
if (!$next || $el->get_item_sign($next) ne $el->get_item_sign($el) ) { |
443
|
|
|
|
|
|
|
$w->say('\end{' . $list_name . '}'); |
444
|
|
|
|
|
|
|
unless (exists $el->get_attr->{nested}) { |
445
|
|
|
|
|
|
|
my $tonest = $el->item_level - 1 ; |
446
|
|
|
|
|
|
|
$w->stop_nesting( $tonest ) if $tonest; |
447
|
|
|
|
|
|
|
} |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
} |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
} |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
sub end_write { |
454
|
|
|
|
|
|
|
my $self = shift; |
455
|
|
|
|
|
|
|
$self->w->say('\end{document}') if $self->{headers}; |
456
|
|
|
|
|
|
|
} |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
=head1 SEE ALSO |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
Perl6::Pod, Perl6::Pod::Lib::Include, Perl6::Pod::Lib::Image |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
L |
463
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
=head1 AUTHOR |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
Zahatski Aliaksandr, |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
Copyright (C) 2010 by Zahatski Aliaksandr |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
473
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.8 or, |
474
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
=cut |
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
1; |
479
|
|
|
|
|
|
|
|