Markdent/Handler/HTMLStream/Fragment.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 92.8% 26 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Markdent/Handler/MinimalTree.pm ↑ Summary Markdent/Handler/CaptureEvents.pm »
1 package Markdent::Handler::HTMLStream::Fragment;
2  
3 33 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 33 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 33 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 33 our $VERSION = '0.39';
8  
9 33 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 33 ▶use MooseX::SemiAffordanceAccessor;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 33 with 'Markdent::Role::HTMLStream';
13  
14 ▶sub start_document { }
Subroutine start_document: called CC=1 SCAR=0.0
Pod undocumented
15 ▶sub end_document { }
Subroutine end_document: called CC=1 SCAR=0.0
Pod undocumented
16  
17 33 __PACKAGE__->meta->make_immutable;
18  
19 33 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.39
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) 2021 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
« Markdent/Handler/MinimalTree.pm ↑ Summary Markdent/Handler/CaptureEvents.pm »