titaniumbunker.com

Evil geniuses and world domination are 2 of our goals... we also like Dr Who

Ubuntu ebook template – changes to 13.04 packages

no comment

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

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.

Tags:

Comments are closed.



Categories

Archives

Tags