epub Page Template - index and title

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
Peter Muckle
Posts: 101
Joined: Fri Oct 18, 2019 9:33 pm

epub Page Template - index and title

Unread post by Peter Muckle »

Hi,

I am making epubs and viewing them on Android using Lithium Reader. So far working really well and very usable

Looking at the Page Template, there are references to keywords and topic titles

Code: Select all

   <meta name="keywords" content="<%TOPIC_KEYWORDS%>" />
and

Code: Select all

<IF_TOPIC_HEADER><div class="header"><%TOPIC_HEADER%></div></IF_TOPIC_HEADER>
<IFNOT_TOPIC_HEADER><h1><%TOPIC_TITLE%></h1></IFNOT_TOPIC_HEADER>
I am not sure how the topic keywords are shown in an epub, and I am not getting a topic header or topic title shown in Lithium. I realise it may be a reader problem.

Thanks

Peter
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: epub Page Template - index and title

Unread post by Tim Green »

Hi Peter,
I am not sure how the topic keywords are shown in an epub, and I am not getting a topic header or topic title shown in Lithium. I realise it may be a reader problem.
Definitely the reader. If it want so use the keywords, it can, because they're there in every topic and correctly formatted and referenced. Most readers probably won't do anything with them, however, or not do very much. For example, they might find the keywords with the search function. You can check that by entering a couple of keywords in your project that are definitely not to be found anywhere in the normal text. Then you can search for them in the eBook reader and see what you find.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Peter Muckle
Posts: 101
Joined: Fri Oct 18, 2019 9:33 pm

Re: epub Page Template - index and title

Unread post by Peter Muckle »

Hi Tim,

I found that keywords from anchors aren't included in output, when I added one in a topic it it shown in the html. But I can't find it in search. Not that important because I am probably going to create a separate topic for index and manually code it for epubs.

Regarding the topic headings, the code shows a div with header but this is not displayed (should something show viewing the html file in a browser?). I was hoping to have the topic title above the line.
body.PNG

Cheers

Peter
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: epub Page Template - index and title

Unread post by Tim Green »

Hi Peter,
Regarding the topic headings, the code shows a div with header but this is not displayed (should something show viewing the html file in a browser?). I was hoping to have the topic title above the line.
eBook readers aren't browsers, they aren't even close. While they do render some HTML they are probably more primitive at doing it than the original Mosaic browser that was released directly after Tim Berners-Lee invented HTML in 1989. It's completely up to them what and how they render from the HTML source. Also, the accepted page layout is very strict and anything they don't know they will generally just ignore. You can return to that by resetting the standard template.

If you want to get a richer display of your eBook pages for testing download the free Calibre viewer. However, seeing something there is really only good for a warm, fuzzy feeling of success restricted to your computer only as long as the standard readers ignore pretty much everything that isn't a normal paragraph without formatting... :roll:
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Peter Muckle
Posts: 101
Joined: Fri Oct 18, 2019 9:33 pm

Re: epub Page Template - index and title

Unread post by Peter Muckle »

Hi Tim,

I found that if I edited the epub page template to remove

Code: Select all

<IF_TOPIC_HEADER><div class="header"><%TOPIC_HEADER%></div></IF_TOPIC_HEADER>
<IFNOT_TOPIC_HEADER><h1><%TOPIC_TITLE%></h1></IFNOT_TOPIC_HEADER> 
and replace with

Code: Select all

<div class="header"><%TOPIC_TITLE%></div>
the topic is showing in the header :) I don't understand how the the IFNOT works.

Regarding epubs, I have been testing Lithium on Android in 'scrolled' mode, which turns each topic into a single long, scrollable page, which I find much easier to use on a phone compared with single pages. Swiping moves between topics. Links and anchors work across topics. I show a sub-topic menu as a list of links at the head of the main topic page, with a 'go to top' icon to return to the top. The first topic becomes the home page. I've also added some menu buttons to open main topics, and a manually-created index page. All images are automatically toggles in epub from what I can see. It works more like a website than an ebook I think. Xplains and video work.

screenshot of epub in Lithium
Screenshot_20191224-125215.jpg
I don't find Calibre viewer good for testing, it opens but doesn't play Xplains, and doesn't have a scrolled mode. Also, ewriter is the way to view on desktops.

However, for mobile, offline, viewing I haven't found a better reader than Lithium, although not perfect.

Cheers

Peter
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: epub Page Template - index and title

Unread post by Tim Green »

Hi Peter,
I don't find Calibre viewer good for testing, it opens but doesn't play Xplains, and doesn't have a scrolled mode.
Those are both excellent reasons for using Calibre for testing, because it will show you how 99% of all readers work. You will almost never have a scrolled mode and you will almost never get dynamic content like Xplains. You should never plan on or use either in eBooks because the huge majority of your users won't be able to see them. 8)

The <IF_TOPIC_HEADER> and <IFNOT_TOPIC_HEADER> conditions are based on whether the current topic has a header defined or not.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply