I’ve recorded an episode of HPR, and it’s out today! In this episode I chat about my Ubuntu Ebook Template Project – I’m still battling with giving a voice to my ebooks but hopefully a wise HPR community member might be able to offer some advice.
Why not record your own HPR episode. It’s super fun and easy to do. Head over to Hacker Public Radio and see how easy it is to contribute.
I have been working this evening on the sharing process for ebooks. Tonight I managed to get a book to upload to launchpad and to make it available. Currently it is a nonsense collection of pages, examining aspects of page layouts, and a copy of a 1 star rating for a review of a Steven King follow up to The Shining – Dr Sleep
There is still work to do on the process – currently there needs to be a link made between the installation location (/usr/share/books) and the current user’s directory – but I have some scripts that should accomplish this that were developed as part of the content packaging for Severed Fifth’s Nightmares by design album.
There were a few dependencies that I had forgotten about, but a couple of retries and the process ran successfully.
Build time for the book took 2 minutes.
test2 ebook – as seen in the ubuntu Software Centre
If you want to install the book yourself – add ppa:computa-mike/testbook to your ubuntu system’s software sources.
There’s a guide to adding a PPA to your software sources here.
The raring deb file can be found here.
I have also found a very interesting python library for epub, and I seem to be replicating much of the work that Aleksandar Erkalovi? is doing with this library – so I plan to replace my library with his, adding in any missing features back to the main library (if at all possible). I think this would be the best approach as it reduces duplicated effort.
One of the requirements for the Ubuntu Quickly Ebook template is the ability to re-order chapters. I had worked out a mechanism to re-order the toc (table of Content) entries for chapters, meaning that ordering of the ebook chapters could be performed through an XML modification. That’s great – but it causes a problem for the web interface – primarily that the table of content seen in the web edit would need to be updated every time we added a chapter, and the page ordering would need to be read from there. This would have meant potentially quite a lot of disk activity just to add a chapter. Imagine : I want to add a chapter to my ebook – but that would also mean that I would have to update the content.opf file accordingly. And add to this the complexity of what could happen if I roll back the book, but maintain the new chapters. I suddenly realised that the reordering of chapters is simple – all I need to do is to update the date modified for the chapter files, and that way I can be sure that all chapters are written in the correct order, as they are read in date time order. It automatically ensure that new chapters are added at the end of the book – it’s a a simple solution that requires no alteration to the existing files.
The issue now is that bzr doesn’t track these file changes. I think what I will do is following re-ordering of the pages, I will rebuild the content tables – which will re-create the metadata for chapter ordering… That should allow bzr to recognise the new page order
So in the latest 13.04 repositories, Kompozer is no longer supported. It used to be supported by the Debian project but was dropped in October 2012. The alternative is to install the dependencies manually and then install Kompozer from a deb file provided by the community project. This makes installing Kompozer a less attractive proposition for projects that want to be part of the ubuntu software centre, and rely on kompozer to provide editing functionality. Combine this with the issues I was having trying to automate Kompozer using DBUS, and the drive then is to look at a better alternative.
ubuntu ebook template – web editor
And I think I have one.
I recently completed a python course, and this lead me to look at python much more clearly. I discovered that python has a built in web server, so i started wondering if I could use the CGI services supplied by that server to load and save chapter files from the ebook project. Couple of hours later I have this :
It’s still a work in progress – my UI design skills are somewhat lacking – but it does have some potential. To activate this editor, I created a new command called webedit. This command starts a webserver, and launches a URL in the default browser. The links down the left hand side have dummy data at the moment, but it should be possible to read values from the ebook spine, and present the contents in order. Each link passes a different filename to the server, and that file is read from the project directory and injected into the tinymce control that is in the page. Page layout is defined using jinja, a templating language for python. As a matter of interest I found I had to add cr/lf’s between each line. The template must work on a line by line basis.
I defined the template using Divshot – an online design and layout tool.
This technique currently uses a standard port (8000) – so this could cause issues if you wanted to update multiple books at the same time – it might be possible to catch the error, and increment the port until an available port is identified, but realistically having 2 ebooks on the go at the same time seems unlikely.
I have been experimenting with the functionality of the Ubuntu ebook template. The idea is that if you are writing your book using the template, that the same content can be published to an ebook and an audio book. The new command to accomplish this is :quickly read.
Want to help?
Want to try Ubuntu Quickly for ebooks? then pop over to https://launchpad.net/quickly-ubuntu-ebook and get involved.
Today, I listened with interest to FLOSS Weekly episode 207 – Aaron Newcomb and Dan Lynch were interviewing Denis Defreyne about his product nanoc. I started thinking – about 2 things actually (which for me is quite good).
- Compiling static HTML from markup? That sounds a lot like dexy – I wonder if the 2 could be used together to document – for example an API, and include the results (via dexy), automatically uploading that data through file sync to a webhost?
- I wonder if you could use that to compile things other than websites?
Aaron also seemed to have the same idea, and Denis mentioned that he had used nanoc to compile some C programs, and had heard of some example where files were being compiled to PDF.
But that only stirred more questions. I meandered to the coffee machine, and ordered a plastic cup of fresh brew coffee. I had been wondering if it could be used to package a manuscripts into a Epub file, and I believe it might be possible – the question became one of whether it would add any benefit.
I’m going to put nanoc to one side for the moment, and introduce something new to this blog post – the “novel publishing process”.
Regular readers may notice the the tag cloud for this website shows quite a large preoccupation towards content packaging – I’ll admit it – I’m passionate about content packaging, and have been working on (for a little while now) a pipeline or process to assist the publishers of ebooks. This pipeline basically describes tools that can be used to fulfill some of the requirements of authors, and at the end I’ll examine if there is a possible place for Nanoc within this process.
Goes without saying – when it comes to being creative on a computer, you’re going to need some form of version control. During the 2011 NaNoWriMo event, Fab (of linux outlaws fame) used gitorious to store his manuscript as he was working on it.
Git, BZR, SVN – I’m not going to pick a favourite – all I would suggest is that you play with the version systems available out there, and get used to them, and then pick one and use it. Equally important is backups. The internet is full of cloudy backup stores – from Dropbox to Ubuntu One – think about how you would recover your novel in the event of an emergency.
Here’s where the pipeline gets interesting. You could just start writing a document using gedit – or emacs or whatever your favourite text editor of choice is – however I would suggest that something that allows you to keep track of your chapters, characters etc should be something of importance to the aspiring author, and I think I’ve found one.
Storybook is an open source Java based development environment for managing your novel. You can write up all your character bios, add research notes, google map locations, images, whatever supports you as a writer. It has a timeline, so that you can plot your character states on a timeline, and even allows you the ability to track which characters are dead, and which are alive. The data is stored in a database file based on SQLLite, and therefore your data is never trapped there.
Layout and design
Once you have finished your masterpiece you need to take the text, and any other assets and put them into sigil.
Publishing will produce an epub file – This can now be tested on an ereader of your choice. Ubuntu offers the ereader product (other e-reader products are available)
Amazon do make a Kindle Previewer application available for Windows and Macintosh users – I have managed to get it working under Wine – the following hints should help :
- Download the Amazon Windows installer from here
- Run the installer under wine
- Set the default windows version to be Windows XP
- It may complain that SWT has caused an issue – potentially install VC2008 runtime, using the terminal line : wintricks vcrun2008
- it may crash when loading an epub file – potentially delete ~/.wine/drive_c/windows/winsxs/manifests/*.vc90.*_deadbeef.manifest files (based on a post on wineHQ forum) – this may be because my wine session was set to Windows7