Markdent::Parser - A markdown parser
my $handler = Markdent::Handler::HTMLStream->new( ... ); my $parser = Markdent::Parser->new( block_parser_class => '...', span_parser_class => '...', handler => $handler, ); $parse->parse( markdown => $markdown );
This class provides the primary interface for creating a parser. It ties a block and span parser together with a handler.
By default, it will parse the standard Markdown dialect, but you can provide alternate block or span parser classes.
This class provides the following methods:
This method creates a new parser. It accepts the following parameters:
block_parser_class => $class
This default to Markdent::Dialect::Standard::BlockParser, but can be any class which implements the Markdent::Role::BlockParser role.
span_parser_class => $class
This default to Markdent::Dialect::Standard::SpanParser, but can be any class which implements the Markdent::Role::SpanParser role.
handler => $handler
This can be any object which implements the Markdent::Role::Handler role. It is required.
This method parses the given document. The parsing will cause events to be fired which will be passed to the parser's handler.
This class does the Markdent::Role::EventsAsMethods and Markdent::Role::Handler roles.
Dave Rolsky, >autarch@urth.org<
See Markdent for bug reporting details.
Dave Rolsky, <autarch@urth.org>
Copyright 2009 Dave Rolsky, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Markdent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Markdent
CPAN shell
perl -MCPAN -e shell install Markdent
For more information on module installation, please visit the detailed CPAN module installation guide.