From MobileRead
Jump to: navigation, search

SGF is the native format of Sigil

[edit] Overview

SGF is organized like an ePUB file. To create the file SiGiL just takes whatever the state of the XHTML code is in currently and dumps it as one large XHTML file (in an epub-like container, with the included images etc). The source file looks exactly like what you see in Code View. XHTML is the native working format for Sigil.

Exporting an epub takes the source code, splits it up on chapter breaks, filters out Sigil-specific CSS and XHTML, creates CSS files from <style> tags and then writes it all out. It's a bit more involved than that. So there is some (a lot actually) pre-processing going on.

With SGF, there is no preprocessing. It's the "working" code dumped raw. The benefit here is that the user is isolated from the changes that are made when exporting an epub. With time, dialogs will be added that pop up on import and export (like what Photoshop does for instance) that let the user fine-tune how the file is imported or exported. For example the user could add margins on export, or on import filter out the cruft from HTML exported from Word etc. None of this will happen for SGF, because that format is already "the way it should be". Think of it as Photoshop's PSD.

In the future, when Sigil supports loading and saving of different file formats (RTF, Mobi, LIT, LRF etc... who knows), those formats will conceivably need some specific information recorded that cannot just store in an epub. So when working on it, you would store it as an SGF, and it would have all the possible information you could record in Sigil.

[edit] Looking at the file outside of Sigil

Like ePUB this format is in a zip container. If the extension is changed to zip then windows can display the full content. If 7ZIP is used the extension doesn't require changing.

Personal tools

MobileRead Networks