Sunday, March 20, 2011

Sigil 0.4.0β1

So the first beta of 0.4.0 is now out. You can get it from the downloads area. The changelog follows:

  • fixed an issue with CSS @import rules in the '@import "something.css"' format not being recognized and thus not updated on import
  • removed the "CustomID" basic metadata entry from the Meta Editor; those wishing to use custom ID's can now add them directly to the OPF
  • Sigil now preserves custom unique identifiers in the OPF (issue #552)
  • removed support for the Sigil-proprietary SGF format
  • the user can now edit the OPF file by hand (issue #281)
  • the user can now edit the NCX file by hand (issue #282)
  • the OPF file is now preserved on import (issue #586)
  • the NCX file is now preserved on import (issue #283)
  • the Table Of Contents editor has been replaced with a new Table of Contents sidebar; clicking on an item in this sidebar takes the user to the target location, enabling TOC navigation (issue #100)
  • a dialog now informs the user if his XHTML, NCX or OPF documents are not well-formed XML (with error location and description), thus allowing him to fix the potential problems by hand instead of leaving them to Tidy to fix (issue #519)
  • fixed a rare issue with no tab opened by default when loading epubs
  • made the startup script more robust (courtesy of Craig Sanders) (issue #737)

The big features everyone has been waiting for are now in. The OPF and NCX are now preserved on import, and you can edit them by hand. You can still let the GUI do everything, but you now have the power to make changes directly.

The TOC editor is gone and has been replaced by the TOC sidebar. A button at the bottom of the TOC sidebar allows the generation of the NCX form the headings in your epub. You can ignore that button if you want and just build the NCX by hand. Typing in the NCX file updates the TOC sidebar live, using a background thread to keep things fast and responsive. Clicking on an item in the TOC sidebar takes you directly to the target location. Yes, you can now navigate the epub with the TOC.

A new dialog is now presented to the user when you screw up the markup in your XHTML (and NCX and OPF) files so badly that they become ill-formed XML. Previously Tidy was used to correct such errors, but now this dialog informs you of the problem and lets you fix it by hand if you wish, with the “Fix Manually” option. By selecting the “Fix Automatically” option in the dialog, everything goes through Tidy and it will then fix it for you, just like it did so previously. Basically the dialog is there to let power users skip Tidy’s error correction and fix the problem by hand. Naturally, the dialog tells you the line/column location of the error and a brief description.

With this dialog and the previous Tidy cleaning on/off button (which controlled the dreaded “clean” option), the negative aspects of Tidy are now something you can completely avoid.

This whole NCX/OPF preservation and editing by hand deal required a very thorough rewriting of a lot of Sigil’s internals. This has certainly brought many bugs so bear that in mind.

The whole point of the beta process is to discover and report bugs in unstable versions of the software. So report any bugs you find! And don’t be surprised when you find them, because you will certainly encounter some of them in this beta. If you’re uncomfortable with that, then don’t use the beta. Wait for 0.4.0 FINAL. This is pre-release software, that’s why it’s called a beta.

There were some features that I initially planned for the first beta but that eventually didn’t make the cut. I spent days on one of them to finally realize that it simply isn’t going to work (through no fault of mine, but it’s a long story for a new blog post). The other major feature that didn’t make it in was simply pushed back to a future beta. I’d like feedback and bug reports on the massive rewrite needed to implement OPF/NCX preservation/editing sooner rather than later, so I thought it wise to push the first beta out today.