I've been working on an xHTML microformat
in this thread over here and concurrently working on a set of macros to help format a source TXT or HTML file into it. I prefer to work on the source HTML directly -- no WYSIWYG or Microsoft Word
(ack!) I like to keep my sources clear and human readable.
The macros are for the NoteTab text editor. Macros in NoteTab are called
Clips. If you don't know NoteTab,
you can download it here. Take a look around the site for more info -- and there are at least two useful Yahoo groups for users and Clip-writers.
The basic thing to know is that NoteTab has a side-bar that allows you to double-click on Clips, processing text, running apps, preset search/replace, creating templates, documents, whatever. It has an insanely powerful scripting language, but I find it easily comprehensible -- you'll be writing them yourself in no time. Literally anything that you can do manually, you can script somehow.
What I've attached here are a set of Clip libraries and a basic eBook (which still needs CSS) that I created using the libraries.
There are four libraries, an INI file, a storage folder and a Clipbar (and the BMP files for the Clipbar. Clipbars are not available in NoteTab Light, BTW.) Extract the contents of the zip directly into your
Libraries folder; that folder is either under the NoteTab program directory, or under the Application Data folder (depending on how you install it -- read the help file or check out the site. Personally, I prefer to keep it all under NoteTab.)
The libraries:
xBookMeta deals with the project-level stuff like storage locations, icon themes, project metadata, etc. It will move projects to proper folders when metadata changes, etc. It has a Clipbar, as you need to use it, but don't need it to be in the way of your workflow. It is the master Clip-library.
xBookSpine builds the eBook and contains most of the tools you need to lay out a book with good structure.
xBookEdit has some tools to deal with formatting text, more on a sentence/paragraph level. It includes character entities, etc.
xBookClean has some macros to clean up the project text to make the source (or the project itself) readable, or to convert tags, or select/copy text. Kind of a catch-all, there is more possible here than currently developed.
When first opened, the Clips will want to set up a destination Library folder where you will keep all your projects. And they will do some basic setup.
Projects are stored as:
AuthorLastName_FirstName_MiddleNamesOrInitials\[Series]\[SeriesNumber_]Title_Of_Book\TitleOfBook.html (NoteTab will keep a backup there, too, if you have backups enabled.)
All images are in an
\images sub-folder, all sounds in a
\sounds sub-folder.
The first project is always a record of all your projects -- you cannot (and
should not) edit it, as it is used by the Clips.
Don't mess with the xBookList! But look at it all you like.
Basic workflow:
0) Determine the project. The Clips assume a project oriented work process. (ie: each book is a project.)
1) Assemble the metadata and things like cover image, frontispiece image (optional), series list, author bio, etc. Once you know that...
2)Run the
New Project Clip in the xBookMeta library.. It'll ask for metadata and a source file. Once you've answered that to your satisfaction, it will make a project folder in your chosen library folder and copy all the parts of the book there as you edit. Your original source files remain untouched.
3) Just work your way down the first section of the xBookSpine Clip-library. There are only six required parts to an xBook:
Head/Tail, Cover, Title Page, Verso, Table of Contents and
Colophon.
4) Be smart! I've added a bunch of sanity checks, but I can't think of everything -- you have to understand how to code a basic HTML page to use this effectively.
5) Start a new project and repeat. You can return to an old project at any time, or delete a project, etc.
That's basically it. It has a lot of quirks, and a lot of bugs I'm sure. But you can take a basic text and have a clean, consistent, source-legible eBook in well under an hour. And you can open it later for editing, and it should Just Work...
If anyone
reads the xBook microformat thread,

, you'll see that it has a basic
Spine and
Body layout; that is, there is a series of
divs that make up the throughline of the book (all with
class="Spine") and the content of the book is contained a separate type of
divs (
class="Body"). This should allow for interesting typographical changes via simple CSS modification.
I think I've added just enough
classes and
ids to make everything available to be modified easily.
Table of Contents is, as always, the hardest part. I've included
Parts in the current spec, but not the
Section and
Sub-Section headings. I can imagine such being useful, and I'm willing to take suggestions on how to handle it. Writing Clips to create the TOC as you edit is pretty complex -- I've done it for the other tables, but they are simpler (just having book
Parts makes the link-checking much more difficult, never mind adding Sections and Sub-Sections. TOC still needs to include the other pieces of the books, too, I think (Foreword, Afterword, About the Author, etc.)
It might be easier to generate the TOC after the entire book is edited...
There is a
lot more than I've mentioned here -- it is actually the third library of Clips that I've written to do this, evolving from a specifically REB1100 set that I developed over years. There are dozens of sophisticated (well,
complex) Clips, that range from formatting to database-upkeep. It even has a popup eBook project viewer!
I'm open to suggestions and help! If people use it, I'll write a better description of each Clip library.
Oh, and if you would like to whip up a good CSS for the attached ebook, that would help a lot -- I'm going to write a set of macros for doing that, too, once I've got a handle on it.
m a r