Comments (6)
First thing I noticed: This is throwing an error with my perl 5.18.2
$mobi->debug_on(&debug);
This works:
$mobi->debug_on(\&debug);
from ebook--mobi.
Your code example gives me this:
EBook::MOBI DEBUG mode on
EBook::MOBI generating TOC...
EBook::MOBI::Mhtml2Mobi DEBUG mode on
EBook::MOBI::Mhtml2Mobi Storing HTML in the mobi format at record 1
<html>
<head>
<guide>
<reference type="toc" title="Table of Contents" filepos="00000186"/>
</guide>
</head>
<body>
<h2>Head1 not in TOC</h2>
hello world<br />
more text<mbp:pagebreak />
<h1>Table of Contents</h1><!-- TOC start -->
<p><ul>
</ul></p>
<mbp:pagebreak />
<h2>Head 2 page 2 in TOC</h2>
<p>some paragraph text</p>
<mbp:pagebreak />
<h4>Head 4 page 3 in TOC</h4>
<p>some paragraph text</p>
plain content<mbp:pagebreak />
</body>
</html>
This seems like a reasonable output at the first glance.
I used perl 5.18.2 and EBook::MOBI 0.67
from ebook--mobi.
Yes, but the list for TOC is empty
Table of Contents
from ebook--mobi.
The TOC so far can only handle level one titles. So if you use level one titles like
$c->title('Head 2 page 2 in TOC', 1,0)
it will work:
<h1>Table of Contents</h1><!-- TOC start -->
<p><ul>
<li><a filepos="00000342">Head 2 page 2 in TOC</a></li><!-- TOC entry -->
</ul></p>
from ebook--mobi.
OK thanks, all working for me now. Perhaps a comment is needed in the documentation for the add_toc_once method to indicate that you need to create level 1 headers (a h1 HTML tag) for any entries to go into the TOC.
from ebook--mobi.
It is already documented. But i made it bold now in commit b5ffde9
from ebook--mobi.
Related Issues (20)
- Feedback Garu - Methods for simple Text HOT 1
- Fit image command into the POD standard HOT 1
- POD error in EBook::MOBI::Mhtml2Mobi HOT 1
- other example for debug_on() method HOT 1
- Minimalistic Example in Synopsis HOT 1
- Add Support for HTML in POD to Docs HOT 1
- Change image resizing system HOT 1
- Unneeded files in Release 0.55 HOT 1
- Remove GD as dependency (and add title images?) HOT 1
- 2013 HOT 3
- Remove Image::Imlib2 from dependency HOT 1
- Problems with \Q as input HOT 3
- Add Test for finished Book HOT 1
- UTF-8 handling in EBook::MOBI HOT 7
- how to set font of the mobi ? HOT 4
- Failing build tests since 0.58 HOT 10
- MOBI::Converter title method, cannot turn off TOC flag HOT 8
- Image support relies on external (non Perl) imlib2 program, no Windows support HOT 7
- <ol> generates items called 65535 or no numbering HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ebook--mobi.