Friday, August 9, 2013

The e-book template (full version)

The template for an e-book is an html  package containing a head and a body. Each can contain several elements. In my basic template, the head contains the book's title, the author's name, and a link to the external style sheet posted earlier.

<!DOCTYPE html>
<title>Your Book Title Goes Here</title>
<link rel="stylesheet" type="text/css" href="epub.css">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >

<!--Insert your title page here-->

<!--Insert your table of contents here-->

<!--Insert your book file here-->

<!--Insert copyright and author pages here-->


"Html" stands for "hyper-text mark-up language," a typically geeky title for what is really a very simple system for building web pages. All e-books are html at heart. Most html tags are doubled: the plain tag comes in front of the word or section to be affected, and a similar tag with a diagonal slash closes it off. Thus the statement <b>bold</b> comes out looking as bold. If you forget the closing tag, the rest of your book will be bolded.

There are excellent tutorials on the internet about html and style sheets (usually called CSS for cascading style sheet, another geeky term). Unfortunately most of them describe styling far beyond the needs of the author-publisher.

In other posts, I describe how I build the table of contents, title page, and text chapters of my e-books. Because I use the epub format, the html can be very simple. The html  shown here, for example, won't pass a validation test because it omits most of the throat-clearing that makes html look so frightening. E-books don't need that all that stuff--and if the truth be known, neither do most web pages. If uploaded to a website, the template above will work as a web page just as it is, with the only content being the statement "Your book content goes here". (In addition, "Your Book Title Goes Here" will appear as the name of the page.)