Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 01-30-2017, 01:04 PM   #1
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
2 CODES: variant forms of spelling



These 2 codes for linking a content entry to the chapter - they work both (separately of course). Question: There are any differences (in the outcome) or not?

Code:
  <h4 id="uAIKIQFfF5UME83PA4zUdR8"><a href="Inhalt.html#qwerty">II. Bar</a></h4>

  <h4><a href="Inhalt.html#qwerty" id="uAIKIQFfF5UME83PA4zUdR8">II. Bar</a></h4>

Last edited by chaot; 01-30-2017 at 02:34 PM.
chaot is offline   Reply With Quote
Old 01-31-2017, 08:40 AM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Effectively they will do the same thing. However, the link will point to the element with the ID. <h4 id=...> would link to the <h4> tag, while <a id=...> points to the actual letters themselves. If you have some bizarre css styling it could throw off your result. Such as:

CSS
h4 {margin-top:15em}
or
a {margin-left:75%}

could have the link point to the incorrect page on smaller screens, or the wrong point on the page.
Turtle91 is offline   Reply With Quote
Advert
Old 01-31-2017, 03:54 PM   #3
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
If these were generated by an automatic program then the semantics is causing you to see different outcomes that go to essentially the same place. The h4 id is a normal target for forward links in TOC's while the id generated inside the href statement was probably generated to allow for a return link to allow you to return after the jump.

Dale
DaleDe is offline   Reply With Quote
Old 01-31-2017, 04:15 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,877
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Are you still insisting on making headers into links? It's a waste of code and given that you have amount of space in each ePub XML, you really don't want to have this code that can be done with link(s) in the NCX ToC.
JSWolf is offline   Reply With Quote
Old 01-31-2017, 05:47 PM   #5
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by JSWolf View Post
Are you still insisting on making headers into links? It's a waste of code and given that you have amount of space in each ePub XML, you really don't want to have this code that can be done with link(s) in the NCX ToC.
Programs like Atlantis and Sigil and many others use headers to generate the NCX TOC automatically. But since they usually use the text in the headers the headers entries are important.

Dale
DaleDe is offline   Reply With Quote
Advert
Old 01-31-2017, 06:13 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,877
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DaleDe View Post
Programs like Atlantis and Sigil and many others use headers to generate the NCX TOC automatically. But since they usually use the text in the headers the headers entries are important.

Dale
That's nothing to do with what I am trying to say. I'm trying to say to NOT use the headers as links to link back to the internal ToC. That's just looks shabby and takes up space that could maybe be needed to keep within the mobile ePub specs.
JSWolf is offline   Reply With Quote
Old 02-01-2017, 01:14 AM   #7
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
I understand you don't like inline TOC which is your right but not everyone agrees. In this case I wasn't even talking about inline TOC. The link back I was referring to was a footnote. A perfectly acceptable way to to any sort of paper.

Dale
DaleDe is offline   Reply With Quote
Old 02-02-2017, 05:51 AM   #8
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Allow me to start the question with clearer formulation and code again.

To @JSWolf Now we speak about an general coding question!

Click image for larger version

Name:	Files Browser.png
Views:	234
Size:	6.1 KB
ID:	154692
Files Browser Title A & Title B are chapters with headers in <h2> tags. Each chapter includes one second title Aa and one subtitle SubtitleAa (respective Bb & SubtitleBb) in <h2> resp. <h3> tags.

Chapter Title A would look like:
Code:
<body>
  <h2 id="auto1Gen1Code1">Title A</h2> 

  <p>Introducing text</p>

  <h2 id="auto2Gen2Code2">Aa</h2>

  <p>Some text</p>

  <h3 id="auto3Gen3Code3">SubtitleAa</h3>

  <p>More text</p>

  <h2 id="auto4Gen4Code4">End</h2>  

  <p>Closing phrase</p>

<body>
Question: In ereader: How I jump back from header Aa or SubtitleAa to
a) Content or
b) to the respective entry there?
(We don't speak about the auto-generated ToC.)

Quote:
Originally Posted by Turtle91 View Post
Spoiler:
Effectively they will do the same thing. However, the link will point to the element with the ID. <h4 id=...> would link to the <h4> tag, while <a id=...> points to the actual letters themselves. If you have some bizarre css styling it could throw off your result. Such as:

CSS
h4 {margin-top:15em}
or
a {margin-left:75%}

could have the link point to the incorrect page on smaller screens, or the wrong point on the page.
To allow for all possibilities: <hx id=...> instead of <a id=...> !

Quote:
Originally Posted by DaleDe View Post
... while the id generated inside the href statement was probably generated to allow for a return link to allow you to return after the jump.
Exactly!

I think now I have expressed myself clearly.

Last edited by chaot; 02-02-2017 at 06:01 AM.
chaot is offline   Reply With Quote
Old 02-02-2017, 05:56 AM   #9
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,877
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What I think would work would be to have the main header to the left and the sub-headers for that section to be indented. Then a blank line for the next section and so on.
JSWolf is offline   Reply With Quote
Old 02-02-2017, 07:34 AM   #10
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by chaot View Post
Chapter Title A would look like:
Code:
<body>
  <h2 id="auto1Gen1Code1">Title A</h2> 

  <p>Introducing text</p>

  <h2 id="auto2Gen2Code2">Aa</h2>

  <p>Some text</p>

  <h3 id="auto3Gen3Code3">SubtitleAa</h3>

  <p>More text</p>

  <h2 id="auto4Gen4Code4">End</h2>  

  <p>Closing phrase</p>

<body>
Question: In ereader: How I jump back from header Aa or SubtitleAa to
a) Content or
b) to the respective entry there?
(We don't speak about the auto-generated ToC.)

Instead of telling you what your styling should look like, the answer to your question is to use an <a> with an href back to your ToC page:

a) To take you back to the top of your Contents page
<h2 id="auto1Gen1Code1"><a href="../Text/contents.xhtml">Title A</a>

b) To take you back to the respective entry ON the Contents page would require each of the entries on the contents page to have a specific id
<h2 id="auto2Gen2Code2"><a href="../Text/contents.xhtml#IDforAa">Aa</a></h2>

and

<h3 id="auto3Gen3Code3"><a href="../Text/contents.xhtml#IDforSubtitleAa">SubtitleAa</a></h3>

where your TOC page has something like this:
Code:
<ul>
<li id="IDforTitleA"><a href="../Text/somepage.xhtml">TitleA</li>
<li id="IDforAa"><a href="../Text/somepage.xhtml#auto2Gen2Code2">Aa</li>
<li id="IDforSubtitleAa"><a href="../Text/somepage.xhtml#auto3Gen3Code3">SubtitleAa</li>
</ul>
Adding the "#" with a specific ID at the end of your href takes you to that specific point on a page. If you do not have the "#" then it just takes you to the top of that page. eg. if your chapter header is the top of the page you do not need the "#".

You can have the id for each item on your contents page either in the <li> as shown in the example above, or in the <a> tag itself (eg <li><a href="../Text/somepage.xhtml" id="IDforTitleA">TitleA</li>)...the result is effectively the same unless you have some really crazy styling as I mentioned in my post above.

Cheers!
Turtle91 is offline   Reply With Quote
Old 02-02-2017, 07:41 AM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,877
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
Instead of telling you what your styling should look like, the answer to your question is to use an <a> with an href back to your ToC page:

a) To take you back to the top of your Contents page
<h2 id="auto1Gen1Code1"><a href="../Text/contents.xhtml">Title A</a>
NO! Do not do that at all. It's going to look awful and it will take up space in the flow that you may want for other things. Plus, it's not needed. The way to make eBooks is to keep them as simple as possible. Making headers into links to go back to the ToC is just so very wrong on so many levels.

ePub has an external ToC that's very easily accessible. You can put links to the internal ToC in there. Also, Kindles don't need this either as they have a similar way to access the ToC. So all this does is look bad, be bad, and is poor coding.
JSWolf is offline   Reply With Quote
Old 02-02-2017, 08:23 AM   #12
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Regardless of JSWolf's opinion about not liking inline ToC...

- It does not look awful...you can style your headers and links however you want to using the appropriate CSS.

- It does not take up ANY space in the flow...its a link...they are non-space taking...

- It is needed if the user wants to have an inline ToC and have their headers take them back to that ToC....which was the OPs question.

- ePubs and some devices/apps do have an external ToC capability. But that was not the OPs question, either.


In conlusion: It doesn't have to look bad....it certainly isn't bad (it's code)...and it's not poor coding. It is how you accomplish what you asked for - regardless of some people's dislike for inline ToC.

BTW, I don't care for inline ToC either, but that makes no difference to the OP. Furthermore, I do believe Amazon/Kindle requires an inline ToC....


Cheers,
Turtle91 is offline   Reply With Quote
Old 02-02-2017, 11:36 AM   #13
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,495
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by Turtle91 View Post
Furthermore, I do believe Amazon/Kindle requires an inline ToC....
From the Amazon Kindle Publishing Guidelines:

Quote:
5 Navigation Guidelines

Amazon strongly recommends the use of an HTML table of contents (TOC) for all books that would benefit from this navigation feature.
...
Amazon requires that all Kindle books include a logical TOC.
So the in-line TOC is recommended, but the logical (NCX) TOC is required.

Last edited by jhowell; 02-02-2017 at 12:34 PM.
jhowell is offline   Reply With Quote
Old 02-02-2017, 12:08 PM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,877
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
Regardless of JSWolf's opinion about not liking inline ToC...

- It does not take up ANY space in the flow...its a link...they are non-space taking...
Any code takes up space. The space is not just allocated for text. It's the size of the entire flow including ALL of the coding.
JSWolf is offline   Reply With Quote
Old 02-03-2017, 12:22 PM   #15
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
So, your only true complaint is that the links make the file size .01 kb larger...noted.

Thanks for the correction jhowell!
Turtle91 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms or Interactive PDF Psyny Amazon Kindle 4 01-12-2015 02:56 PM
Fillable forms soparch ePub 2 06-29-2012 09:12 AM
DR1000 FW2.0 - RC2 - font-variant: small-caps ThR iRex 0 06-29-2010 05:31 AM
John August's sales figures for The Variant Sporadic News 28 07-15-2009 02:23 PM
John August - The Variant (Short Story - $0.99 - Kindle/PDF) Sporadic Deals and Resources (No Self-Promotion or Affiliate Links) 0 05-24-2009 11:16 AM


All times are GMT -4. The time now is 09:17 AM.


MobileRead.com is a privately owned, operated and funded community.