Yesterday, 01:36 PM | #1 |
Addict
Posts: 391
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Why so complicated?
I found this at the top of chapter 1 of a book and I'm wondering why all of this is needed. Wouldn't it be simpler to just label everything that is to go into the TOC with h#s? Sect1 could be a higher h# so it wouldn't get put into the TOC.
If the page should have a few lines, but the TOC only one line per chapter, use the title attribute. Text: Chapter One Words words Some more words TOC: Chapter One: Words words "Some more words" Code:
<section aria-labelledby="hd-chapter001" epub:type="bodymatter chapter" id="chapter001" role="doc-chapter"> <h1 class="chapter-number" id="hd-chapter001"><span epub:type="pagebreak" id="page12" role="doc-pagebreak" title="12"></span><a href="toc.xhtml#toc-chapter001"><span epub:type="pagebreak" id="page13" role="doc-pagebreak" title="13"></span>CHAPTER ONE</a></h1> <h1 class="chapter-title"><a href="toc.xhtml#toc-chapter001">Words words</a></h1> <h2 class="chapter-subtitle"><a href="toc.xhtml#toc-chapter001">“SOME MORE WORDS.”</a></h2> <h1 class="sect1" id="a001">1.</h1> Given no index and the ability to generate a TOC from major Hs, what does "id" accomplish? Why an href to the TOC in an epub? Finally, why epub:type="pagebreak" or ="bodymatter chapter" or role="doc-pagebreak"? Last edited by foosion; Yesterday at 01:41 PM. |
Yesterday, 08:26 PM | #2 |
Bibliophagist
Posts: 39,732
Karma: 154147706
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Section is similar to a div but used to group related content. You will notice that the section in your quoted text has no classes but does include identifiers, roles, epub-type, etc.
The ID is likely used in the ToC instead of pointing to the chapter file, you would get href="part0007.html#hd-chapter001". Add further ids for subchapter entries. The href to the ToC allows you to go back to the ToC by tapping on that entry. A vestige of old practices. Remember when you would see Last:Next:ToC at the top and bottom of chapters? An epub-type is part of ePub3 attributes allowing improved semantics. Originally, it was hoped/hyped that epub-type would improve accessibility but other than some limited success with footnotes, this did not happen. OTOH, a role is an ARIA attribute used to expose information to assistive technology. There is a lot of overlap which is why it was originally hoped to use epub-type but support never materialized. See the EPUB Type to ARIA Role Authoring Guide for more information. |
Advert | |
|
Yesterday, 09:35 PM | #3 |
Addict
Posts: 391
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
That's very helpful. Thank you!
It appears that if I'm editing a commercial work for personal use, want to make the appearance more pleasing to me and don't use assistive technology, I could just enclose each part of the text in bare h# tags, style those as desired in the CSS and delete the rest. I could then generate a ToC from the h# tags, using a title attribute if desired, without needing any href or id. Deleting the "excess" would make things simpler and easier to understand for me. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
It's Complicated | drjenkins | Deals and Resources (No Self-Promotion or Affiliate Links) | 13 | 03-06-2014 12:23 AM |
I'm sure this would be complicated, but is this possible? | Dullahir | Calibre | 5 | 06-03-2013 05:04 AM |
Now Things Get Complicated | Kris777 | News | 21 | 04-17-2010 03:25 AM |
UK User - is it really this complicated?! | twisticles | Sony Reader | 30 | 09-22-2008 10:46 PM |