Dave's blog

Creating eBooks in ePub format

 

File 81One of the websites Tarakan created and continues to manage is Architecture & Governance Magazine, a community site with several hundred articles on the arcane art of Enterprise Architecture. A&G started as an actual print magazine, but it was discontinued with the success of the website. They continue to publish a PDF file for each issue, which is downloadble on the website.

Recently someone commented that they'd also like an eBook version of the current issue. Seemed like a reasonable request, and I was curious about the process of creating an eBook, so I decided to delve into it. And that world is still quite a mess.

An evolving standard used in iBooks and other places is the ePub format - "EPUB became an official standard of the International Digital Publishing Forum (IDPF) in September 2007, superseding the older Open eBook standard."  A single ePub book file is just an archive of other files, including XHTML and CSS for content and formating, an OPF file for metadata and ordering, and media files. 

I searched around the intertubes for info on creating ePub format eBooks and ... well, good information and tools are scarce.  So I just dug in, trying all the tools I could find to create a eBook from various sources files in A&G Issue 6-6. I had all the source text documents in RTF format, the original Adobe InDesign source file to create the PDF, the finished PDF, and all the image files. 

File 79First I tried Calibre, a "a free and open source e-book library management application" which seems geared more toward eBook reading and library management. It has numerous conversion options though, so I plugged in the PDF file and hit "convert". I received an unreadable 100 page mess of graphics and text.  Converting from a fixed-layout print-centric PDF to a flowable multi-sized text-centric epub format wasn't going to be as simple as clicking a button.  I played with it a bit more, putting in the source documents and it worked better, but I could not get a new article to display on a fresh page- it just flowed through.

I had discovered a few intereting websites on ePubs, including the oddly named and likely search engine confusing Pigs, Gourds and Wikis. The author wrote a book that focuses exclusively on ePub, which I wound up buying (although in dead tree format via Amazon, because it was cheaper than the ePub format .. go figure).  It focuses on using Word or InDesign to create ePub books, along with some chapters that go into the process more deeply than anything else I had found. I found another post that goes way deep into the format, but focused too much on roll-your-own for me- I was looking for a simpler, more automated approach (since we might be doing this more frequently).

I happened to have InDesign CS5 and the Issue 6-6 InDesign source file, so I tried to follow her method in the book above. But again, trying to take a print-centric file and convert it was going to take too much manual effort to make a nice looking eBook. That and I had very little experience with InDesign.  So what else..?  A little more searching helped me find Sigil, "a multi-platform WYSIWYG ebook editor. It is designed to edit books in ePub format."  Sounded perfect.

File 80And it pretty much is- it works very well.  I had learned from the Pigs.. website that the only way to get chapter breaks to work in iBooks was to create a separate XHTML file for each chapter, so I created three XHTML files, one for each article in Issue 6-6. I cut & pasted the text from the RTF files into Sigil, which stripped all formatting. That was ok- it is better to start clean and build up, so I used the WYSIWYG features of Sigil to add heading tags, bold and italics and bullet points. I could even add images, although getting text to flow around them requires some CSS work (a similar method is shown in the ePub book). Perhaps a future version of Sigil will include a WYSIWYG method to make images inline.

The Table of Contents was created automatically using the Heading tags (so be sure to use them correctly- h1, h2, ..). I used the Meta Editor to add information on the Title, Publisher, Author, etc of the eBook. I took a screenshot of the PDF and created a document for it and moved it to the first- this caused it to be used as the cover image (maybe there is a better, more explicit way to do this, but I haven't found it yet).  And voila- that's it.  Since Sigil edits the ePub format directly, there is no conversion process - just save and you have an ePub.  The resulting eBook looked great on my iPad.

Sigil is a nice app for creating a simple ePub format eBook quickly. You'll have to dig into the code if you want to do anything more sophisiticated, but it has a nice split-screen code editor for that.  So unless you know InDesign well, I'd start with Sigil and see what you can do with it.

Creating Mobile Websites with Drupal Part 3

In Part 1 of this series we looked at the Why of building mobile websites.  In Part 2 we discovered how to analyze your website for mobile traffic. Here in Part 3 we will look at a few ways to mobilify your website.

The Sledgehammer Approach

First there is the "Draconian" solution- change your Drupal theme to a "mobile friendly" theme.  One option is the appropriately named Mobile theme, which is "intended to return only clean HTML with no styling ... inks and sidebars are placed in such a place that mobile- or handheld-devices can display just the content."  Let's look at a live example to see what that does.  Below is the normal desktop and mobile versions of a page on a site we did a while back:

File 69   File 70

The desktop version looks nice, but the mobile version is hard to read without zooming. According to Google Analytics, more mobile users go straight to this page (to see where the band is playing that night) than go to the home page. So we need an optimized mobile page.

If we install and enable the Mobile theme, then we get this on a mobile device for that page:

File 71

Well, it looks ... different.  Less messy.  But not necessarily better. And since this is a sledgehammer approach, all pages, viewed on mobile or desktop, are affected.  Looks what it does to the front page on a desktop browser:

 File 72

We've basically ruined our site.  Those images should be part of a JQuery slideshow on the front page.  So the sledgehammer approach might not be the best.  But, what if we could just show a different theme to mobile devices, keeping our pretty theme for desktop users.  Sounds like a good step.

Mobile Tools Module

For that we look to the Mobile Tools Drupal module.  It provides many mobile-centric features to a Drupal site, but we will focus on just two:

  • automatic detection of the "user agent" - is the user accessing the site from a mobile device?
  • automatic theme switching based on mobile / not mobile

Working together, those two features will ensure that mobile users get the "Mobile" theme while non mobile users get the regular theme.  And it is super-simple to enable- just go to the Mobile Tools settings and set it to switch theme for a mobile device, then pick the theme:

 File 73

You could also create a mobile version of your website, and put it somewhere like "mobile.mysite.com".  You can use Mobile Tools to automatically redirect mobile users to your mobile version.  The Domain Access module might be of use in that scenario as well.

We are making progress ... but really the Mobile theme is too simplistic to produce good results for our site.  There are few other mobile themes available - Adaptivetheme Mobile, Nokia Mobile, A Cloudy Day Mobile, and even Mobile Garland!  There's even a mobile base theme, Fuse.

Mobile-specific Custom Theme

For optimal results, and if you have themeing resources, creating a custom theme just for mobile users is your best choice.  We created a mobile theme for our example site above, with the following rather nice result:

 File 74

Thirty-Party Solutions

If you don't have the know-how or resources to build your own mobile theme, there are some thirty party options that might be easier / cheaper than paying someone else to do it.  

When I first did this presentation at DrupalCamp Austin 2009, there was a company called OSMobi that had a nice drag-drop interface for mobilizing your site. Not that nice I guess, since they went under by the time I updated this presentation and did it at OpenCamp / DrupalCamp Dallas in 2010.  

Another company, Mobify, has a similar solution with a combination Drupal module / Web app.  First you use the web app to identify the pages of your site that you want Mobify to mobilize:

File 75

You can also add custom CSS if you'd like.  You then use their Drupal module to set the custom Mobify.com subdomain that mobile users will get when they come to your site (like "mysite.mobify.com").  The result is actually rather nice:

File 77

The downside?  You have less control of course.  And anything other than the basics costs money. And the price keeps going up- their highest-end package was $49 / month when I first looked at them, was $499 / mon last fall, and is now $999.  So get in now while you can still afford it!

This concludes my series on Building Mobile Websites with Drupal- hope it was useful.  And of course, Tarakan Design is ready and willing to help you create your own mobile sites.

Creating Mobile Websites with Drupal Part 2

In Part 1 of this series we looked at the Why of building mobile websites.  In Part 2 we'll look at how to analyze your website for mobile traffic. We will use this information in Part 3 to correctly plan and implement the mobile version of our website.

Google Analytics

So how do you know if mobile visitors are even visiting your website, and if so- which pages do they frequent?  Google Analytics (GA) is a good tool for this, and is already installed on many sites.  If not- get the GA Drupal module and install it.  Then sign up for Google Analytics- it's free- add your site, and get the "UA-xxxxxxx" number for that site (it will come with a code snippet they send you- you just need that number).  There is a field for that number in the GA settings page on your site- put it in, save, and ... wait.  It takes at least one day before GA will have any data on your site, and perhaps many more days or weeks (depending on your traffic level) before you have enough data.

Below is a typical Dashboard for GA - this one shows a month of overall traffic for one site:

File 66

Good info, but we specifically are looking for info on our mobile visitors. One method of figuring that out is to look at screen resolutions.  You can do this by drilling down into "Visitors Overview >> view report" then "screen resolutions".  Below is a real example

 File 67

Notice that #5 is "320 x 480" and #6 is "320 x 396" - either mobile devices, or a 1970 greenscreen terminal.  So we are getting maybe 11% of our traffic from mobile devices, which is likely enough to cause us to develop a better mobile version.  If that number was 0.1% then it probably isn't worth the effort.

GA can further break down the mobile traffic by device, if you need to know that.

File 68

More importantly is - what pages do mobile visitors read?  Often it is different than desktop users.  GA can tell you that as well, so you can make sure those pages are very mobile friendly.

Ok, so we know we are getting mobile traffic, and on what pages.  In Part 3 we will discuss ways to "mobilizificate" your Drupal site.

Creating Mobile Websites with Drupal part 1

Back in August I gave a presentation at OpenCamp on building mobile sites with Drupal.  I thought I'd put that presentation into a serialized set of blog posts.  I'll split this up into three posts:

  1. Why build mobile websites?
  2. Does your website get mobile traffic?  Which pages?
  3. Building a mobile-specific site with Drupal module/theme options and 3rd party options

Why Build Mobile Websites?

Let's look at a website that we built for a Dallas band a few years ago, first on a desktop / laptop :

Full page website screenshot with Flash

It's a Drupal site (of course) that features a Flash intro (I know, I know..) of a taxi driving by while the band tries to hail it down, then we fade into the actual front page of the website.  It's actually quite striking on a full size screen with Flash support, and with all the menu options functional you can easily skip the Flash intro.

But if you view that same website on your iPhone, you get a totally different experience (and not a good one).  A page that is perfectly formated for 17-19" monitor is likely very hard to read and manipulate on your mobile device.  And since your iPhone doesn't support Flash, you just see (sort of- it's small) a "Please Install Flash" banner, and nothing else happens.

File 53

Not a compelling experience for your user. The user can switch to landscape mode, or zoom in and scroll around to use the site, but that's hardly optimal.  And there's no getting around the lack of Flash.

You've likely noticed that when you visit some sites on a mobile device, the site displays a very different-looking website from the desktop version.  USAToday.com is a good example- first the desktop version:

File 57

And then the first three pages as views on an iPhone:

File 58    File 59    File 60

The mobile view is totally different, yet is well organized and easy to manipulate.

Amazon.com also handles mobile well - here is typical front page as seen on a desktop:

File 54

The front page is full featured and full of information and images.  If you visit on an iPhone though, the first two pages look like:

File 55    File 56

There is much less information and very few images (which helps the mobile site load faster over a cellular data network).  There are mobile-looking buttons and a prominent search field, as well as a link to the "PC site" should the user wish to view the site in desktop mode.

The desktop and mobile environments are very different, and must be treated differently by your website:

File 61

Enough for Part 1 - next time in Part 2 we'll explore how to figure out what sort of mobile traffic is coming to your site and which pages they are visiting (so you know which to optimize for mobile first).

Dallas Drupal and Lullabot Dinner

File 45
Some of the Lullabots were in town for a week of training, so some of us Dallas Drupal types invited them out for dinner Monday night.  We enjoyed some open-air TexMex and talked some Drupal.  

We had a big crowd show up (> 20), as sort of evidenced by this really crappy iPhone photo.  The Lullabots brought half their class with them.  We're taking one of the 'bots, Randy the UltraCyclist to ride the Wish 100K cycling rally with us this Saturday.  

Syndicate content

Our Philosophy

 

  • Customer centered, Agile development
  • Clear and open communication
  • Solid software engineering principles

 

Drupal

Drupal

 

We use the Drupal Content Management Framework for secure and reliable websites.
Learn More