line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Markdent::Handler::HTMLStream::Fragment; |
2
|
|
|
|
|
|
|
|
3
|
32
|
|
|
32
|
|
261550
|
use strict; |
|
32
|
|
|
|
|
85
|
|
|
32
|
|
|
|
|
1153
|
|
4
|
32
|
|
|
32
|
|
195
|
use warnings; |
|
32
|
|
|
|
|
72
|
|
|
32
|
|
|
|
|
1079
|
|
5
|
32
|
|
|
32
|
|
668
|
use namespace::autoclean; |
|
32
|
|
|
|
|
17626
|
|
|
32
|
|
|
|
|
289
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.38'; |
8
|
|
|
|
|
|
|
|
9
|
32
|
|
|
32
|
|
4746
|
use Moose; |
|
32
|
|
|
|
|
1387853
|
|
|
32
|
|
|
|
|
288
|
|
10
|
32
|
|
|
32
|
|
238418
|
use MooseX::SemiAffordanceAccessor; |
|
32
|
|
|
|
|
39373
|
|
|
32
|
|
|
|
|
285
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Markdent::Role::HTMLStream'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
4
|
0
|
|
sub start_document { } |
15
|
|
|
|
2
|
0
|
|
sub end_document { } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
__PACKAGE__->meta()->make_immutable(); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# ABSTRACT: Turns Markdent events into an HTML fragment |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__END__ |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=pod |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=encoding UTF-8 |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Markdent::Handler::HTMLStream::Fragment - Turns Markdent events into an HTML fragment |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 VERSION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
version 0.38 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
This class takes an event stream and turns it into an HTML document, without a |
40
|
|
|
|
|
|
|
doctype, C<< <html> >>, C<< <head> >> or C<< <body> >> tags. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 METHODS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This role provides the following methods: |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 Markdent::Handler::HTMLStream::Document->new(...) |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This method creates a new handler. It accepts the following parameters: |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=over 4 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item * output => $fh |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
The file handle or object to which HTML output will be streamed. If you want |
55
|
|
|
|
|
|
|
to capture the output in a string, you can open a filehandle to a string: |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $buffer = q{}; |
58
|
|
|
|
|
|
|
open my $fh, '>', \$buffer; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
If you pass a file handle (or L<IO::Handle> object), then all calls to |
61
|
|
|
|
|
|
|
C<print()> will be checked, and an error will be thrown. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
You can pass an object of any other class, it must implement its own |
64
|
|
|
|
|
|
|
C<print()> method, and error handling is left up to this method. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=back |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 ROLES |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This class does the L<Markdent::Role::HTMLStream>, |
71
|
|
|
|
|
|
|
L<Markdent::Role::EventsAsMethods>, and L<Markdent::Role::Handler> roles. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 BUGS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
See L<Markdent> for bug reporting details. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Bugs may be submitted at L<https://github.com/houseabsolute/Markdent/issues>. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 SOURCE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
The source code repository for Markdent can be found at L<https://github.com/houseabsolute/Markdent>. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 AUTHOR |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This software is copyright (c) 2020 by Dave Rolsky. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
94
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
The full text of the license can be found in the |
97
|
|
|
|
|
|
|
F<LICENSE> file included with this distribution. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |