Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 01-31-2017, 07:26 AM   #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
Possible CODE-variations?

What's the better way to code the content list of a book?

Code:
<p><a href="Xyz.html">Xyz</a><br/>

  <a href="abc.html#DeF">DeF</a><br/>

  <a href="abc.html#Ghi">Ghi</a></p>

or

<p><a href="Xyz.html">Xyz</a></p>

  <p><a href="abc.html#DeF">DeF</a></p>

  <p><a href="abc.html#Ghi">Ghi</a></p>

Last edited by chaot; 02-02-2017 at 02:46 AM. Reason: correcting: ... Ghi</a><br/></p> → ... Ghi</a></p>
chaot is offline   Reply With Quote
Old 01-31-2017, 07:36 AM   #2
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,983
Karma: 128903378
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 chaot View Post
What's the better way to code the content list of a book?
If your first link to a given file is the beginning of the file, do not use an ID. Also, forget the <br/>. That's poor coding. Use a <p></p> with or without a class as needed.
JSWolf is offline   Reply With Quote
Advert
Old 01-31-2017, 08:33 AM   #3
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,095
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
I agree with Jon about not needing an ID if you are linking to the top of the page, but I disagree with his statement that it is "poor coding" to use <br/>. There are two different purposes for the <br/> (go to the next line) and the <p> (start a new paragraph element). Technically (semantically) you aren't starting a new paragraph with each line of a TOC so a <br/> (or a <div> for that matter) would work fine. Effectively they will do mostly the same thing under most conditions, but they are semantically different. Honestly, if there isn't a specific reason for using one or the other, it's a matter of preference for which one you use.

I personally use the <p> tags... but that's just a habit instead of any particular reason.

Cheers,
Turtle91 is offline   Reply With Quote
Old 01-31-2017, 03:49 PM   #4
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
Semantics do matter. Another interesting fact about /br is that it is ignored in the TOC generation by programs that auto-create the toc. So a multi-line title will show as one line in the TOC which is useful sometimes.

Dale
DaleDe is offline   Reply With Quote
Old 01-31-2017, 04:22 PM   #5
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,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I've reported that all four threads on this one ToC be merged.

Last edited by JSWolf; 01-31-2017 at 04:25 PM.
JSWolf is offline   Reply With Quote
Advert
Old 01-31-2017, 10:54 PM   #6
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by Turtle91 View Post
There are two different purposes for the <br/> (go to the next line) and the <p> (start a new paragraph element). Technically (semantically) you aren't starting a new paragraph with each line of a TOC so a <br/> (or a <div> for that matter) would work fine. Effectively they will do mostly the same thing under most conditions, but they are semantically different.
A new paragraph usually looks very different from a <br> tag. The line break tag puts the following content exactly one line height of spacing lower than the text before it, as though the current paragraph wrapped to a new line. A new paragraph adds that space plus the paragraph's margin, which by default means that it looks roughly like two <br> tags in a row.

For a TOC, I would tend to use <ul><li> or <ol><li>. The content you're formatting is semantically a nested list. With the right styling, it can look like anything you want it to look like, but using proper list tags preserves the semantics of the content in the structure, which can be beneficial in some screen readers, IIRC, and also is useful for folks scraping the book and processing it in interesting ways.

So the short answer is that you probably shouldn't use either of the styles that you asked about.

Last edited by dgatwood; 01-31-2017 at 10:56 PM.
dgatwood is offline   Reply With Quote
Old 02-01-2017, 06:50 AM   #7
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,983
Karma: 128903378
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 dgatwood View Post
A new paragraph usually looks very different from a <br> tag. The line break tag puts the following content exactly one line height of spacing lower than the text before it, as though the current paragraph wrapped to a new line. A new paragraph adds that space plus the paragraph's margin, which by default means that it looks roughly like two <br> tags in a row.
That depends on how the CSS is coded. I code my CSS so <p></p> does not add any extra space. I use a top and bottom margin of 0. Sono, the <p></p> does not have to add any space. Also, you can use a class to further define how the ToC entries are coded.
JSWolf is offline   Reply With Quote
Old 02-01-2017, 10:53 AM   #8
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,095
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 JSWolf View Post
That depends on how the CSS is coded. I code my CSS so <p></p> does not add any extra space. I use a top and bottom margin of 0. Sono, the <p></p> does not have to add any space. Also, you can use a class to further define how the ToC entries are coded.
So you use:
<p class="someclass">something</p>
<p class="someclass">someone</p>
<p class="someclass">somewhere</p>

to duplicate the look of:
<p class="someclass">something<br/>someone<br/>somewhere</p>

interesting.

Although, as I said, I use something like:
<div class="someclass">
<p>something</p>
<p>someone</p>
<p>somewhere</p>
</div>

and define CSS:
div.someclass p {whatever}

There are multiple ways to make it look the same. The only real difference is how semantically correct you want it to be. I actually think dgatwood had the better argument that a <ul><li> is more semantically correct.

It's just very difficult to understand why you would tell someone their way is "poor coding" and yet you give them an example of equally poor coding without explaining your reasoning.

Cheers!
Turtle91 is offline   Reply With Quote
Old 02-01-2017, 11:09 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,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Because <br/> is always described as poor coding.
JSWolf is offline   Reply With Quote
Old 02-01-2017, 11:13 AM   #10
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
Quote:
Originally Posted by JSWolf View Post
I've reported that all four threads on this one ToC be merged.
What is this about?
chaot is offline   Reply With Quote
Old 02-01-2017, 11:14 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,983
Karma: 128903378
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 chaot View Post
What is this about?
It's about the fact that you started FOUR different threads on this ONE ToC.
JSWolf is offline   Reply With Quote
Old 02-01-2017, 11:33 AM   #12
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
Sorry! It's not like this. In all my recently opened threads, different questions are dealt with. In my opinion, a merger is impossible. I contradict this request most decidedly.
chaot is offline   Reply With Quote
Old 02-01-2017, 12:16 PM   #13
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
A list of contents is a list per definitionem. And that's exactly why this should be semantically reflect in the code. (Similar as <i> or <em>.) @dgatwood

Karma is distributed to everyone involved! ...there are many roads leading to Rome. Even if there are good and less good ones.

According to the original look of the book I code an <ul> list inside/not inside (not yet decided) <div></div> tags.

Last edited by chaot; 02-02-2017 at 02:59 AM. Reason: change: Same → Similar
chaot is offline   Reply With Quote
Old 02-01-2017, 12:26 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,983
Karma: 128903378
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 chaot View Post
Sorry! It's not like this. In all my recently opened threads, different questions are dealt with. In my opinion, a merger is impossible. I contradict this request most decidedly.
I disagree. These questions could have been asked in one message.
JSWolf is offline   Reply With Quote
Old 02-01-2017, 12:38 PM   #15
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
Supreme forum rule: One question - one thread.
Otherwise complaints will come, one would spare the effort of different threads.

And even if you were right here, I will learn much more on this path, or better said on these paths. That's it!

Last edited by chaot; 02-10-2017 at 12:20 PM. Reason: Supreme (divine) forum → Supreme forum, grammatical issues
chaot is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cover page variations: Suggestions please? AndrewMowere Writers' Corner 22 12-29-2016 07:01 PM
Merge Author name variations to a list mkkyah Library Management 15 11-13-2016 03:32 PM
4fff n618 and variations frq More E-Book Readers 22 04-04-2011 09:02 PM
Classic What do Nook firmware variations 1.4.1, 1.4.2, 1.4.3 mean? chas0039 Barnes & Noble NOOK 6 11-15-2010 12:45 PM
Puzzled by contrast variations in e-ink Sunspark News 3 12-15-2009 03:53 AM


All times are GMT -4. The time now is 12:10 AM.


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