Giter Site home page Giter Site logo

ebook--mobi's People

Contributors

abbypan avatar borisdaeppen avatar garu avatar manwar avatar reneeb avatar rupertl avatar szabgab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ebook--mobi's Issues

Unneeded Message

This message should be removed:

Version: 2 - 2 -  DOC_COMPRESSED

MOBI::Converter title method, cannot turn off TOC flag

Current code is as follow

sub title {
   my $self = shift;
   my $txt  = shift;
   my $lvl  = shift || 1;
   my $toc  = shift || 1;

If the final argument is not present, or set to zero, then shift returns nothing and the OR operator sets $toc to 1. But documentation suggest that a false value will mean title is not included in the TOC.

The following code solved this for me.

sub title {
   my $self = shift;
   my $txt  = shift;
   my $lvl  = shift;
   my $toc  = shift;

   unless (defined($toc)) {
      $toc = 1;
  }

Empty Table of Contents created after content added with converter object

Iโ€™m using the following code to make a MOBI book. All the contents goes in, but the table of contents is just an empty list. I followed your simple_mobi.pl example which uses the driver to add content in POD format and it worked fine. But adding content without using a driver seems to cause the TOC to not generate correctly

Regards,

Kim


use EBook::MOBI;

my $mobi = EBook::MOBI->new();

let's define a debug sub witch will be used by all modules

sub debug {
my ($package, $filename, $line) = caller;
print "$package\t$_[0]\n";
}

pass the reference of the sub to our book

$mobi->debug_on(&debug);

my $c = EBook::MOBI::Converter->new();

$mobi->add_mhtml_content($c->title('Head1 not in TOC', 2,0) );
$mobi->add_mhtml_content("hello world");
$mobi->add_mhtml_content( $c->newline);

$mobi->add_mhtml_content("more text");
$mobi->add_pagebreak();

$mobi->add_toc_once();
$mobi->add_pagebreak();

$mobi->add_mhtml_content($c->title('Head 2 page 2 in TOC', 2,0) );
$mobi->add_mhtml_content( $c->paragraph('some paragraph text') );
$mobi->add_pagebreak();

$mobi->add_mhtml_content($c->title('Head 4 page 3 in TOC', 4,1) );
$mobi->add_mhtml_content( $c->paragraph('some paragraph text') );
$mobi->add_mhtml_content("plain content");
$mobi->add_pagebreak();

$mobi->set_filename('mobi_test.mobi');

$mobi->make();
$mobi->save();

$mobi->print_mhtml();


HTML output

Head1 not in TOC

hello world

more text<mbp:pagebreak />

Table of Contents

<mbp:pagebreak />

Head 2 page 2 in TOC

some paragraph text

<mbp:pagebreak />

Head 4 page 3 in TOC

some paragraph text

plain content<mbp:pagebreak />

Failing build tests since 0.58

You can see the latgest log here http://ppm4.activestate.com/MSWin32-x86/5.16/1600/B/BO/BORISD/EBook-MOBI-0.67.d/log-20131028T200829.txt and previous logs here http://code.activestate.com/ppm/EBook-MOBI/

Activestate wont load versions that don't pass, so 0.58 is the latrst one they have. www.cpantesters.org currently down so can't check whats happening there.

Also, not sure if this is related to the above, but this link doesn't work http://search.cpan.org/~borisd/EBook-MOBI-0.68-TRIAL/ so can't easily browse content, test results etc, as we can for Ebook-MOBI-Image.

Image support relies on external (non Perl) imlib2 program, no Windows support

To insert images, the Image::Imlib2 module is a dependency. This in turn requires the imlib2 program to be installed.

This package is only available for Linux, no Windows version, which means I can't create any images if I want to use this module. Also Imlib2 doesn't seem to have many recent updates, and some people have had trouble configuring it: http://cpanratings.perl.org/dist/Image-Imlib2

There are several pure perl modules that will rescale images, including Image::Imager and Image::Scale . They will work on all operating systems and seem to be more actively maintained

If it is not practical for you to switch to one of these alternatives, I suggest you add a LIMITATION section to your documentation, outlining no MS Windows support.

A note about needing to install imlib2 binaries or compile the package locally would also help, but may this should probably go into the MOBI::Image module doco.

Minimalistic Example in Synopsis

The most minimalistic Example ever should be added too

Like:

use EBook::MOBI;
my $book = EBook::MOBI->new();
$book->add_mhtml_content("hello world");
$book->make();
$book->save();

Add Test for finished Book

Test of a finished Book could be made over a Checksum:
Create "Hello-World"-Book in a temporary directory, make checksum, compare that with a handmade hardcoded checksum, if not equal, fail.

Unneeded files in Release 0.55

v0.55 is 170.28K and this actually can't be...
A short check shows:

$ find EBook-MOBI-0.55 | grep \.mobi\$
EBook-MOBI-0.55/BigSimple.mobi
EBook-MOBI-0.55/Simple.mobi

Dist::Zilla keeps on fooling me!

<ol> generates items called 65535 or no numbering

use 5.010;
use strict;
use warnings;

use EBook::MOBI;
my $book = EBook::MOBI->new();

$book->add_mhtml_content(q{
<p>&lt;ol&gt; and &lt;li&gt; oddly number the rows with 65535.</p>
<ol>
  <li>First entry</li>
  <li>Second entry</li>
</ol>
}
);

$book->add_pagebreak();

$book->set_title( 'A new MOBI book generated by EBook::MOBI' );
$book->set_author('Gabor Szabo');
$book->set_encoding(':encoding(UTF-8)');
$book->print_mhtml;

$book->make();
$book->save();

The resulting file will show two list items having the order number 65535 when viewed on the desktop Kindle reader on OSX.
When reading on real Kindle, they show no numbering at all.

I wonder if this is a bug in the module, the viewer or Kindle itself?

I wonder if this

UTF-8 handling in EBook::MOBI

I'm having some problems getting UTF-8 encoded text to work with EBook::MOBI. Please see the following gist

https://gist.github.com/rupertl/5975866

When I view the created file book.mobi in an eReader such as Calibre or fbReader, the first two lines (English and German) display OK but the next two (Chinese and Japanese) do not.

The MOBI format should support full UTF-8 so I suspect there is an issue in encoding non ISO-8859 characters

Tested using EBook::MOBI 0.64 and perl 5.16.3 on Linux.

Problems with \Q as input

Issue #22 mentioned the problem and offered a fix.
However the tests fail after merging, so I have made a reset to the last working commit.

I'll have to take a closer look at the issue.

2013

Add year 2013 to "COPYRIGHT & LICENSE" section.

other example for debug_on() method

this also works

$plugin->debug_on(  sub {
                        my ($package, $filename, $line) = caller;
                        print "$package\t$_[0]\n";
                    }   
                 );  

and is more elegant.
Can be shown in the examples!

Feedback Garu - Methods for simple Text

An idea of https://github.com/garu

"When I got to EBook::MOBI, I was
looking for a module that would let me write text in MOBI format.
Reading would also be nice, but not necessary my particular need at
that moment. I was a bit frustrated when I realized I had to convert
my stuff to pod and only then have the MOBI file ready. I saw there
was some kind of way to write raw content with the add_mhtml_content()
method, but it can get really frustrating - specially when there is no
easily reachable documentation pointing to what exactly the MHTML
format is."

Feedback Garu - Book as variable

https://github.com/garu wishes:

"[...] another thing I missed is a way to get the data as a
variable instead of as a file. This would let me serve the generated
"book" via Web or send it directly to a Kindle device without having
to save a temporary file on disk."

Feedback Garu - Allow Plugins

https://github.com/garu brought up this idea:

"how about just extending your API so it lets other people create MOBI
files without having to learn mhtml? Then turn the POD-specific code
into a pluggable system (e.g. EBook::MOBI::Driver::POD, already
bundled into your dist) that talks to this API, so people can create
other converters as well, such as from MarkDown, Word (.doc), PDF,
etc."

Add Support for HTML in POD to Docs

With release 0.53 the POD-Plugin can handle "=begin html" blocks, but I forgot to add it to the docs for the plugin... need to do that later once

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.