View Single Post
Old 01-03-2014, 08:55 AM   #109
stevelitt
Member
stevelitt began at the beginning.
 
Posts: 13
Karma: 24
Join Date: Dec 2013
Location: Florida, USA
Device: Kindle
Quote:
Originally Posted by capidamonte View Post
stevelitt,

Strict (X)HTML source documents with custom parsers for target devices is the elegant answer, I think.
Hi capidamonte,

Bless your heart for saying that! All my publisher friends are telling me what a turkey I am for sourcing Xhtml instead of (ugh) MS Word or (gulp) a PDF file or (what could *possibly* go wrong) send it to a service, so every minor update involves a week's delay and a fifty dollar charge.

Quote:
Originally Posted by capidamonte View Post

Write your converters individually (Kindle 1, iPad3, Kobo, Nook, etc.) Some may require document rewriting (old MOBI image sizes, for instance), specialized splitting into various files, and of course, individualized css docs for various targets.
:-)
Well, of course we're working toward that ideal, but for the time being, I'll settle for outputting a standard ePub and converting that with Calibre, or Calibre plus Kindlegen. I never said it on this forum, but my reason for creating this software is so that in 2014, I can write a (short) eBook every two weeks. That means very soon now I need to quit programming and start slamming out content.

But yeah, some day I'll have different converters for different devices.

Quote:
Originally Posted by capidamonte View Post

For your root doc structure, I suggest that you simply up your H#s by one.

H1: book element (title, cover, appendix, body, toc, list of maps, etc.)

H2: Parts within the body (eg: Book 1, Part 1, Volume 1), or glossary (eg: A, B, ... Z) or appendices (eg: Art Deco, Post-Modern) et al.

H3: Chapters within the body (mostly) or appendices (more rare) and other such elements that need them. There may be other Chapter analogues in books that I'm not thinking of. An extensive glossary may need something like Sa-Sn, Sm-Sz for instance.

H4, H5, H6: Sub-sections of a Chapter, as necessary. See above re: glossary for further refinement in non-body book elements.
capidamonte, I think you're going to like this. My program operates off two things: The Xhtml source doc, and a Yaml config file. The Yaml config file defines the relationship between <h?/> tags and things like Part, chapter, section, subsection, etc. Because of course not all books have parts, and it's conceivable a small, 99 cent eBook might not even have chapters. That same Yaml config file also defines which H numbers get their own pages, and which ones go in the table of contents.

Because my philosophy is that the Frontmatter and Backmatter are completely different animals than the mainmatter, I *don't* use <h?> tags for anything in the frontmatter or backmatter. Instead, I let the book author use something like <p class=foreward/>, and if the book author wants the section to get its own page, which is how I make a heading appear at the top of the page, the book author puts <div class="_pagebreak_"/> right above the <p class=foreward/>. But you just reminded me that I need to let the author determine, on a case by case basis, which frontmatter or backmatter elements get put in the tables of contents. So, in the <div class="_pagebreak_"/>, I'll probably have an attribute called "contents" that can have a value of Y or N, if the Xhtml will still parse and show up in a browser (for viewing while authoring the book). If the author doesn't put in that attribute, the default is not to put it in the contents.

Quote:
Originally Posted by capidamonte View Post

Proper classes in different elements will help with divergent styling needs (<h2 class="body">, <h2 class="appendix">) either for aesthetics or for eReader compatibility.

Relatively simple and, if standardized, easy to convert to various forms of ePub or MOBI.

This was my plan, originally, back when I worked for Hitch -- but I got sidetracked by life.
Thanks for this advice. It at once gives me ideas, and re-enforces my belief that I'm on the right track.

I should have this program written, tested, documented, Expat (free software) licensed, and available for download on Troubleshooters.Com within a week. I'll let you guys know when it's done.

And THANK YOU, all of you, for all the help.

SteveT
stevelitt is offline   Reply With Quote