-
-
26 Sep 2015 09:11:16 UTC
- Distribution: EBook-MOBI
- Module version: 0.72
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (682 / 0 / 0)
- Kwalitee
Bus factor: 1- 46.99% Coverage
- License: artistic_2
- Activity
24 month- Tools
- Download (324.73KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
EBook::MOBI::Driver::Example - Example plugin implementation.
This module is just for demonstration. I invented a very simple markup, which works only line by line, to show how a plugin can be created.
SYNOPSIS (for users)
If you wan't to run this as a plugin, use this code. But I can't imagine any situation where this might be the case for real, since this is just an example for a markup which is not actually existing.
use EBook::MOBI; my $book = EBook::MOBI->new(); my $foomarkup= <<FOOMARKUP; !h! This is a Title ! ! A normal text line. !i! An italic text line. ! ! This is just a very simple example of markup. !b! Guess what. This is a bold line. typo : this is ignored !U! unknown command FOOMARKUP $book->add_content( data => $foomarkup, driver => 'EBook::MOBI::Driver::Example', );
SYNOPSIS (for developers)
Here you can see how the plugin will be called by EBook::MOBI:
use EBook::MOBI::Driver::Example; my $plugin = EBook::MOBI::Driver::Example->new(); my $format= <<FOOMARKUP; !h! This is a Title ! ! A normal text line. !i! An italic text line. ! ! This is just a very simple example of markup. !b! Guess what. This is a bold line. typo : this is ignored !U! unknown command FOOMARKUP my $mobi_format = $plugin->parse($format);
Please check the source code of this module if you are interested in writing a plugin. It will be a good and simple example.
Methods
parse
This is the method each plugin should provide! It takes the input format as a string and returns MHTML.
inherited methods
See EBook::MOBI::Driver for usefull inherited methods. You can use the debug methods from this module for example.
COPYRIGHT & LICENSE
Copyright 2012, 2013 Boris Däppen, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms of Artistic License 2.0.
AUTHOR
Boris Däppen <bdaeppen.perl@gmail.com>
Module Install Instructions
To install EBook::MOBI, copy and paste the appropriate command in to your terminal.
cpanm EBook::MOBI
perl -MCPAN -e shell install EBook::MOBI
For more information on module installation, please visit the detailed CPAN module installation guide.