Markdent.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 18 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 ## no critic (Moose::RequireMakeImmutable)
2 package Markdent;
3  
4 use 5.010;
5 use strict;
6 use warnings;
7  
8 # The first version that completely worked with newer versions of Specio.
9 use Moose 2.1802 ();
10  
11 our $VERSION = '0.40';
12  
13 1;
14  
15 # ABSTRACT: An event-based Markdown parser toolkit
16  
17 __END__
18  
19 =pod
20  
21 =encoding UTF-8
22  
23 =head1 NAME
24  
25 Markdent - An event-based Markdown parser toolkit
26  
27 =head1 VERSION
28  
29 version 0.40
30  
31 =head1 SYNOPSIS
32  
33 use Markdent::Simple::Document;
34  
35 my $parser = Markdent::Simple::Document->new;
36 my $html = $parser->markdown_to_html(
37 title => 'My Document',
38 markdown => $markdown,
39 );
40  
41 =head1 DESCRIPTION
42  
43 This distribution provides a toolkit for parsing Markdown (and Markdown
44 variants, aka dialects). Unlike the other Markdown Perl tools, this module can
45 be used for more than just generating HTML. The core parser generates events
46 (like XML's SAX), making it easy to analyze a Markdown document in any number
47 of ways.
48  
49 If you're only interested in converting Markdown to HTML, you can use the
50 L<Markdent::Simple::Document> class to do this, although you can just as well
51 use better battle-tested tools like L<Text::Markdown>.
52  
53 See L<Markdent::Manual> for more details on how Markdent works and how you can
54 use it.
55  
56 =head1 QUICK MARKDOWN TO HTML CONVERSION
57  
58 If you just want to do some quick Markdown to HTML conversion use either the
59 L<Markdent::Simple::Document> or L<Markdent::Simple::Fragment> class.
60  
61 This distribution also ships with a command line tool called L<markdent-html>.
62 See that tool's documentation for details on how to use it.
63  
64 =head1 PROCESSING PIPELINES
65  
66 If you want to create a Markdown processing pipeline, start by looking at the
67 various handler classes:
68  
69 =over 4
70  
71 =item * L<Markdent::Handler::HTMLStream::Document>
72  
73 =item * L<Markdent::Handler::HTMLStream::Fragment>
74  
75 =item * L<Markdent::Handler::HTMLStream::Multiplexer>
76  
77 =item * L<Markdent::Handler::HTMLStream::HTMLFilter>
78  
79 =item * L<Markdent::Handler::HTMLStream::CaptureEvents>
80  
81 =back
82  
83 You will probably also want to write your own handler class as part of the
84 pipeline. This will need to implement the L<Markdent::Role::Handler> role.
85  
86 To do that you'll need to review the many C<Markdent::Event::*> classes. Each
87 event represents something seen by the parse, such as a piece of the start or
88 end of a piece of block (paragraph, header) or span markup (strong, link) or
89 some text.
90  
91 The start of a pipeline will generally be either the L<Markdent::Parser> or
92 L<Markdent::CapturedEvents> class.
93  
94 =head1 CUSTOM DIALECTS
95  
96 You may also want to implement a custom dialect to add some additional features
97 to the parser. Your parser classes will need to consume either the
98 L<Markdent::Role::Dialect::BlockParser> or the
99 L<Markdent::Role::Dialect::SpanParser> role. The best way to understand how a
100 dialect is implemented is to look at one of the existing dialect classes:
101  
102 =over 4
103  
104 =item * L<Markdent::Dialect::GitHub::BlockParser>
105  
106 =item * L<Markdent::Dialect::GitHub::SpanParser>
107  
108 =item * L<Markdent::Dialect::Theory::BlockParser>
109  
110 =item * L<Markdent::Dialect::Theory::SpanParser>
111  
112 =back
113  
114 You'll also need to dig into the core L<Markdent::Parser::BlockParser> and
115 L<Markdent::Parser::SpanParser> classes in order to see how these dialects
116 interact with the core parser.
117  
118 =head1 DONATIONS
119  
120 If you'd like to thank me for the work I've done on this module, please
121 consider making a "donation" to me via PayPal. I spend a lot of free time
122 creating free software, and would appreciate any support you'd care to offer.
123  
124 Please note that B<I am not suggesting that you must do this> in order for me
125 to continue working on this particular software. I will continue to do so,
126 inasmuch as I have in the past, for as long as it interests me.
127  
128 Similarly, a donation made in this way will probably not make me work on this
129 software much more, unless I get so many donations that I can consider working
130 on free software full time, which seems unlikely at best.
131  
132 To donate, log into PayPal and send money to autarch@urth.org or use the button
133 on this page: L<http://www.urth.org/~autarch/fs-donation.html>
134  
135 =head1 BUGS
136  
137 Please report any bugs or feature requests to C<bug-markdent@rt.cpan.org>, or
138 through the web interface at L<http://rt.cpan.org>. I will be notified, and
139 then you'll automatically be notified of progress on your bug as I make
140 changes.
141  
142 Bugs may be submitted at L<https://github.com/houseabsolute/Markdent/issues>.
143  
144 I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>.
145  
146 =head1 SOURCE
147  
148 The source code repository for Markdent can be found at L<https://github.com/houseabsolute/Markdent>.
149  
150 =head1 DONATIONS
151  
152 If you'd like to thank me for the work I've done on this module, please
153 consider making a "donation" to me via PayPal. I spend a lot of free time
154 creating free software, and would appreciate any support you'd care to offer.
155  
156 Please note that B<I am not suggesting that you must do this> in order for me
157 to continue working on this particular software. I will continue to do so,
158 inasmuch as I have in the past, for as long as it interests me.
159  
160 Similarly, a donation made in this way will probably not make me work on this
161 software much more, unless I get so many donations that I can consider working
162 on free software full time (let's all have a chuckle at that together).
163  
164 To donate, log into PayPal and send money to autarch@urth.org, or use the
165 button at L<https://www.urth.org/fs-donation.html>.
166  
167 =head1 AUTHOR
168  
169 Dave Rolsky <autarch@urth.org>
170  
171 =head1 CONTRIBUTORS
172  
173 =for stopwords Andrew Speer Denis Ibaev Jason McIntosh Jonas Smedegaard Konrad Bucheli Polina Shubina Shlomi Fish Stefan Hornburg (Racke) Tom Hukins
174  
175 =over 4
176  
177 =item *
178  
179 Andrew Speer <andrew.speer@isolutions.com.au>
180  
181 =item *
182  
183 Denis Ibaev <dionys@gmail.com>
184  
185 =item *
186  
187 Jason McIntosh <jmac@appleseed-sc.com>
188  
189 =item *
190  
191 Jonas Smedegaard <dr@jones.dk>
192  
193 =item *
194  
195 Konrad Bucheli <konrad.bucheli@gmx.ch>
196  
197 =item *
198  
199 Polina Shubina <925043@mai.com>
200  
201 =item *
202  
203 Shlomi Fish <shlomif@shlomifish.org>
204  
205 =item *
206  
207 Stefan Hornburg (Racke) <racke@linuxia.de>
208  
209 =item *
210  
211 Tom Hukins <tom@eborcom.com>
212  
213 =back
214  
215 =head1 COPYRIGHT AND LICENSE
216  
217 This software is copyright (c) 2021 by Dave Rolsky.
218  
219 This is free software; you can redistribute it and/or modify it under
220 the same terms as the Perl 5 programming language system itself.
221  
222 The full text of the license can be found in the
223 F<LICENSE> file included with this distribution.
224  
225 =cut