- SYNOPSIS (for users)
- SYNOPSIS (for developers)
- COPYRIGHT & LICENSE
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.
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', );
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.
This is the method each plugin should provide! It takes the input format as a string and returns MHTML.
See EBook::MOBI::Driver for usefull inherited methods. You can use the debug methods from this module for example.
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.
Boris Däppen <email@example.com>