Perhaps you want to craft beautiful ebooks. The open industry-standard format, EPUB, is pretty good and very comprehensive, but it’s not really intended for making books by hand.
Zhook keeps it simple. Just create a webpage (yes, probably a very long webpage) and zip it up.
Zhook is really easy to test. You can do most of your testing in any modern web browser (such as Firefox, Chrome, Safari, Opera or IE9). If you zip and upload it here, you can do further testing and tweaking quite quickly with Ochook.org tools.
Zhook has higher-fidelity semantics. This is because Zhook uses HTML5, which has more useful semantic elements (like grouping headings together with hgroup, or captioning an image with figure). We have good uses for all that semantic richness, as you’ll see.
And perhaps most importantly:
Well that’s easy. Here are the steps:
index.html.cover.png..zhook.That’s it.
With EPUB, you put each chapter or part of the book in a separate HTML file. That’s sensible, but a bit redundant. With Zhook, you can just put each part (or ‘component’ in Zhook parlance) in an article element — these will be ‘componentized’ when the book is converted to EPUB, or opened in a Zhook reading system that supports components.
<body>
<article>
<h1>Loomings</h1>
<p>Call me Ishmael...</p>
</article>
<article>
<h2>The Carpet-Bag</h2>
<p>I stuffed a shirt or two into my old carpet-bag...</p>
</article>
</body>
You have fine-grained control if you need it. Read all about How a Zhook may be split into components.
HTML has great support for “document outlining” — which is to say, if you use h1, h2, h3 (etc) elements for your headings, a table of contents can be automatically generated from your mark-up. Using HTML5 section elements (like section, article, header, footer) and heading grouping with hgroup, you have complete and surprisingly intuitive control over your table of contents.
<hgroup>
<h1>Oh! The Places You'll Go</h1>
<h2>by Dr. Seuss</h2>
</hgroup>
<h3>Congratulations!</h3>
<p>Today is your day.</p>
<p>You’re off to Great Places!</p>
<p>You’re off and away!</p>
<h3>You have brains in your head.</h3>
<p>You have feet in your shoes.</p>
<p>You can steer yourself any direction you choose.</p>
Produces:
Zhook follows the detailed WHAT-WG recommended algorithm for outlining. If you want the exact rules, read all about it. The Mozilla Developer Center also has a good write-up of HTML outlining.
Why not use the standard meta tag in the head of index.html?
<meta name="title" content="Oh! The Places You'll Go" />
<meta name="creator" content="Dr. Seuss" />
First of all, they’re in your browser. If you use Safari or Chrome, the Web Inspector comes bundled with the browser. It’s perfect for testing and tweaking your mark-up and styles. Firefox has the Firebug extension, which does the same thing but even better.
For testing your Table of Contents, try the h5o bookmarklet. It’s a bit rough and ready, but it works.
Use your favourite text editor or WYSIWYG HTML editor. Use your favourite zipping tool. There’s no arcane command-line incantation required to zip up a Zhook.
And then you might decide to come here, to Ochook.org, to upload your Zhook. If you do, you can:
index.html, or upload an updated ZhookTry it now: publisher.ochook.org
There’s no login required to upload your Zhook, but there is a reasonable limit on the number of uploads you can make per day. You can only modify your Zhook (metadata or index file) if you use the “private” option when publishing.
Reasonable precautions are taken to keep your data safe. If something goes wrong, it’s not our fault. If you’re unhappy with that, you shouldn’t use this service.
Zhook has a specification. It’s quite short.
The philosophy of Zhook is that reading systems should tell book designers how formatting will be affected by their implementation. This is usually achieved adequately with documentation. For example: “position: absolute is ignored”, or “<p> tags are split in two across page boundaries”, or whatever. Almost all reading systems modify the Document Object Model or CSS of a HTML document in some way, and these changes will have an effect on certain style rules. EPUB does not require Reading Systems to declare their DOM or CSS modifications. Zhook does.
But otherwise, Zhook tries to avoid getting in the way of innovation. It’s not locked to a particular version of HTML or CSS. Instead it offers book designers a few ways to detect reading system layout capabilities and utilise them. In this way, Zhook is optimised for progressive enhancement.
Similarly, Zhook provides a microformat mechanism for extending the functionality of reading systems. For example, if the system provides a special interface for footnotes, you can unobtrusively mark-up your document to work with it; other systems will display footnotes naturally at the end of the component.
All of which is to make a point: Zhook’s specification is quite short. We’d like to make it shorter and simpler, so get in touch if you have a suggestion.
Here is the Zhook specification in full:
What’s this Ochook business? Basically, an Ochook is a Zhook in its unzipped state (see, the “Z” comes from “Zip”, so it’s doesn’t make sense to call an unzipped Zhook a Zhook).
But it turns out that an unzipped Zhook is a useful thing. Firstly, it’ll be readable in any browser. If it’s extracted to a directory that is being served by a web server, well then, anyone can read the book just by going to a URL.
Including, for instance, not just other people but other Zhook reading systems. That’s a pretty powerful idea. Books in the cloud and all that.
There’s just one extra thing we can do to help other systems read our unzipped Zhooks off our servers. That is to tell them the location of every component and resource used in the Zhook, so that they can download them and cache them locally, for speed and offline accessibility.
To do this, we use a HTML5 standard, the application cache manifest. This manifest file should contain a list of all the files in the zip. For a Zhook to be an Ochook, the manifest should be called ‘ochook.manifest’. And it should be referenced in the manifest attribute of the <html> element in your index.html file.
If you do that, then most modern browsers will automatically cache the book so that it can be accessed offline. In fact, it’s called an Offline Cache, which is where the “Oc” in “Ochook” comes from.
If you upload a Zhook to Ochook.org, we’ll automatically create this manifest and add it to your index.html file. Easy!
If you want to discuss Zhook, we suppose you could try the #zhook hashtag on Twitter. Alternatively, we have a Google Group. If the group is a bit quiet, blame Twitter.
Zhook is an idea that emerged from Inventive Labs, who built this website. We don’t own the idea though. If it takes you anywhere, take it with you.