Professional Documents
Culture Documents
Sigil 0.2.0 Manual
Sigil 0.2.0 Manual
Release 0.2.0
Strahinja Markovic
CONTENTS
Introduction 1.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The main user interface 2.1 What are all these les? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 The Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 3 3 5
Find & Replace 9 3.1 Wildcard mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2 Regular expression mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Book Browser 13 4.1 Content folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.2 Context menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Meta Editor 17 5.1 Collapsed UI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5.2 Expanded UI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Table Of Contents Editor 6.1 Building the TOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 The editor interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3 Advanced uses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 21 23 23
EPUB Overview 25 7.1 Open Publication Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 25 7.2 Open Packaging Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 7.3 OEBPS Container Format . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Glossary 31
ii
CHAPTER
ONE
INTRODUCTION
Sigil is a free and open source editor for the EPUB format. It is designed for easy, WYSIWYG editing of EPUB les and for converting other formats to EPUB. It also provides features for advanced users, like direct XHTML, CSS and XPGT editing. You can use it to add any of the metadata entries supported by the EPUB specication and create a hierarchical Table of Contents. The editor works on all three major platforms: Windows, Linux and Mac OS X. Sigil is a work in progress, and as such is still missing many features. If you have the programming skills, you can directly contribute to its development. Even if you dont, just using Sigil and reporting any bugs or missing features on the issue tracker will go a long way towards making it a better application for everyone.
1.1 Installation
Installing Sigil is fairly easy on all platforms. The les can be downloaded from the download section of the project site.
1.1.1 Windows
On Windows, you merely run the the appropriate installer. If you have a 64 bit version of Windows, you should use the Windows installer labeled with x86_64. Otherwise, use the vanilla one. Then just run it. Everything should take care of itself. If you get an application conguration is incorrect message when starting Sigil, see this item in the FAQ. Sigil is tested on XP, Vista x64 and Windows 7 x64.
1.1.2 Linux
Run the installer for your CPU architecture. Two are available: x86 and x86_64. If in doubt, use the x86 one. The Qt Framework is included in the installer. 1
Sigil Manual, Release 0.2.0 You have to do this from the console. First, make the installer executable and then run it:
chmod +x installer.bin sudo ./installer.bin
After the installer completes, there should be an icon on your desktop and an entry in your start menu. Sigil can be uninstalled by running the uninstall executable located in the folder in which Sigil was installed. By default, this is /opt/sigil. So with default options, uninstalling Sigil would look like this:
cd /opt/sigil sudo ./uninstall
1.1.3 Mac OS X
Unpack the DMG le and drag the Sigil.app le to your Applications folder. Sigil is built as a universal binary, and is tested on Mac OS X 10.5 and 10.6. Sigil should also work on Tiger (10.4), but is untested on that version of Mac OS X.
Chapter 1. Introduction
CHAPTER
TWO
So Sigil presents a le-focused editing environment. You can open every XHTML le and edit it in a WYSIWYG manner in the Book View, or edit the code directly in the Code View. You can edit the CSS, XPGT and other les, and view the images one by one. To add and edit that special information like the Table of Contents and the metadata, Sigil presents you with purpose-built editors. You can access them through the Tools menu. Everything you enter in them is saved and exported when the resource les are bundled together and the EPUB book is built. When you open the resulting EPUB le in some RS, it will be displayed as a paged book.
CHAPTER
THREE
10
Sigil Manual, Release 0.2.0 Character a ? * [...] Matches Any character represents itself by default. a would match a. Matches any single character. Matches zero or more of any characters. Any character in the set; [abc] would match a or b or c.
So if for example you used the search string [123]abc?dd* with the Wildcard mode selected, it would match any of the following: 1abceddertert, 3abc9dd--.!, 2abc_dd!#$79840sd 12adad ad and many more.
The current regex engine used is actually Qts QRegExp. It will eventually be replaced with PCRE because of the latters advanced features and performance.
11
12
CHAPTER
FOUR
BOOK BROWSER
The Book Browser (BB) offers a view into the structure of your EPUB book. You can see all the different les that make up the archive, from XHTML les to images. Hint: If your not familiar with the internal structure of an EPUB le, see the EPUB Overview chapter. The Book Browser pane can be either docked, or undocked. A docked BB can be undocked by clicking on the little window icon in the top right corner, and docked by simply dragging the new window to the edge of the main Sigil window and then releasing the mouse button. An image of it undocked can be see in Book Browser, undocked. You can also open and close the Book Browser through the View menu.
13
14
For those interested in the technical details, this information is stored in The OPF les <guide> element. 2 Sigil looks for a normal <img> tag or an SVG <image> one.
15
16
CHAPTER
FIVE
META EDITOR
The Meta Editor is what you use when you want to add or edit metadata for your EPUB book. As the EPUB Overview explains, the standard allows for hundreds of different metadata entries to be added to any book.
5.1 Collapsed UI
When you rst open the Meta Editor, it will be in its collapsed state, as shown in Meta Editor, collapsed. This allows you to add the minimum metadata elements that all EPUB books need to have: the Title of the work, the Author and the Language in which it is written. If you dont include these elements, then tools like epubcheck will complain that your book has errors (rightfully so). This information is the bare minimum you should provide. You can always go the extra mile though. The expanded version of the dialog enables you to do just that.
Figure 5.1: Meta Editor, collapsed Hint: You can list several authors of a book by separating the names with a semicolon. Like this: Smith, John; Doe, Jane.
17
5.2 Expanded UI
If you click on the More button, the dialog will expand; see Meta Editor, expanded. You now have a table listing all the other types of metadata present in your EPUB book. You can remove an item by selecting it and clicking the Remove button, or add new items with the Add Basic and Add Adv[anced] buttons.
Figure 5.2: Meta Editor, expanded The basic metadata items (see Basic metadata list) are things like the dates of publication, creation and modication; description; content coverage; intellectual property rights; the ISBN, ISSN and DOI numbers etc. You dont need to use any of these, the only ones that are required are the aforementioned title, author and language. But if you do know any of this information, do add it to your books. While there are only a few basic metadata items, theres more than two hundred advanced entries (see Advanced metadata list), ranging from Illustrator to Patent holder to
18
Figure 5.3: Basic metadata list Performer. These all describe the various contributors to a work, and are terms dened and used by the Library of Congress. Hint: Do you see the line that divides the list of metadata entries and the description text? Put your mouse cursor over it. Yes, it can be dragged to increase/decrease the amount of space for the description area. In any eld where you are expected to enter the name of a person (like Author or Performer), try to write the name in a normalized form. For instance, instead of John Smith, write Smith, John. Why? Because the EPUB standard provides alternate ways of storing the metadata information for people involved with the work. If you use John Smith, Sigil will store this information as just John Smith and nothing else. But if you use Smith, John (notice the comma), then the name will be stored in two ways. People who read your book will then see John Smith, but the Reading System will categorize the book under Smith, John. This makes machine processing easier, and also makes more sense for anyone searching through their book collection. Hint: For the technical details regarding the storage of metadata, see The OPF le.
5.2. Expanded UI
19
20
CHAPTER
SIX
3 3
4 3
Usually, the natural TOC that Sigil creates using this technique will be enough for 90% of the books youll want to make. But you can always make changes directly. Hint: For the technical details regarding the storage of the Table of Contents, see The NCX le.
21
22
The attribute should hold the alternate text that should be used for the TOC. You can also use this functionality to have images as the targets of the TOC entries:
<h1 title="Text in TOC"><img src="..Images/some_image.png" /></h1>
23
24
CHAPTER
SEVEN
EPUB OVERVIEW
The EPUB format is a standard created by the International Digital Publishing Forum (IDPF). It consists of three separate specications: Open Publication Structure (OPS), which describes how the content is to be presented; Open Packaging Format (OPF), which describes how the content les and resources are connected into a logical whole, a publication; OEBPS Container Format (OPS), which describes how the publication is encapsulated in a ZIP archive. This chapter will provide a brief overview of the format aimed at beginners.
25
You would see something very similar to this if you switched to Code View in the main Sigil UI. Notice the pattern: content is marked up between the start and end tags of an element. This is how XML (on which XHTML is based) works. The <p> element is a good example; it delimits the words and sentences that should be regarded as making up a single paragraph. There are many more elements in XHTML. With XHTML, the user semantically marks up the content of the document and species its structure. Usually, a CSS stylesheet is applied to the document. In this example, it is linked with the <link> element; this tells any XHTML renderer to use this stylesheet when rendering the document. What does the renderer do? It looks at the marked-up document and the linked stylesheets and determines how this content should be displayed on the users screen. The XHTML document describes what is the content, and the CSS stylesheet describes how it should be laid out and formatted. XHTML answers questions like: What is a paragraph? What is a list of items? What is a table?, and CSS answers questions like: How much should the paragraphs be indented? What color is the text? What fonts should be used? How big is the text?. You create many XHTML documents 1 for one EPUB le. Customarily, you create one per book chapter, but you can do it differently if you want to (but do so only if you have a good reason). For novels, one stylesheet is usually enough and is used in all the XHTML les. Now you may be wondering, why should readers of an EPUB have to jump from one XHTML le to the next? Why cant they just see the book as one text ow? The answer is that they do. The readers are not aware that an EPUB le is an archive of several different les since their Reading System always displays everything in it as one text ow. Even when every chapter is actually a separate le, when the user pages through their book, they see one chapter ending, and on the next page, the next chapter starting. They are never aware that their Reading System has actually transitioned them from one le to the next. You may be surprised, but Microsoft Words new DOCX format is also several marked-up les inside a ZIP archive. And yet you see it as one document.
In the context of EPUB, XHTML documents are often called OPS documents.
26
27
<itemref idref="chapter002" /> </spine> <guide> <reference type="loi" title="List Of Illustrations" href="loi.xhtml" /> </guide> </package>
You can clearly see the metatada, manifest, spine and guide elements and their children. There really is nothing complicated about this, lots of people end up writing all this information by hand. Its tedious, but doable. Sigil writes this le automatically for you, and in the future it will provide the user with the means of editing it directly if he wants the extra power that comes with this ability.
<docTitle> <text>Tale of Two Cities</text> </docTitle> <docAuthor> <text>Dickens, Charles</text> </docAuthor> <navMap>
28
<navPoint class="chapter" id="chapter001" playOrder="1"> <navLabel><text>Chapter 1</text></navLabel> <content src="chapter00l.xhtml"/> </navPoint> <navPoint class="chapter" id="chapter002" playOrder="2"> <navLabel><text>Chapter 2</text></navLabel> <content src="chapter002.xhtml"/> </navPoint> </navMap> </ncx>
The <navPoint> elements point either to whole documents, or to the specic elements within those documents. They can be nested to create a hierarchical TOC. Sigil creates this le from the headings present in your XHTML documents. Every heading is referenced by a navPoint, and headings of different levels interact to create a hierarchy. More details of this behaviour can be found in the Building the TOC section. As with the OPF le, future versions of Sigil will enable direct editing of this le for those who want it. Note: If your heading is near the beginning of your XHTML le, Sigil will link directly to that le and not to the heading element. This is because on some Reading Systems, linking directly to an element slows down the display of the TOC.
29
30
CHAPTER
EIGHT
GLOSSARY
caret The blinking vertical bar in the text that most people erroneously call the cursor. CSS Cascading Style Sheets. epubcheck A tool used to validate EPUB les. Since EPUB les need to follow the EPUB specication, this tool was made to check for basic errors in the le that would make it non-valid. Do note that it is not a panacea and it is not perfect; it doesnt check everything. Also note that even if epubcheck reports that a le is valid, that doesnt mean the le will render awlessly on all Reading Systems. None of those are perfect either, and they all have their little quirks and idiosyncrasies. With all of that in mind, its still a very good idea to make sure your EPUB les pass epubcheck without errors or warnings. Epubcheck can be downloaded here. metadata The information about the book, like the books title, author, publication date, publisher, subject etc. Reading System Any combination of hardware and/or software that is used to present the EPUB book to the reader. For instance, it can be an application like Adobe Digital Editions or a hardware device like the Barnes & Noble Nook. UI User Interface. WYSIWYG What You See Is What You Get. XHTML Extensible Hypertext Markup Language. XML Extensible Markup Language. XPGT XML Page Template.
31