Changes

Jump to navigation Jump to search
1,435 bytes added ,  08:50, 27 August 2014
ePub directory structure
You don’t need the attributes of the document node, even if we could use the language setting.
 
== ePub structure ==
 
This is the directory structure that we need for our ePub:
 
<pre>
/songbook.tree/
├── META-INF
│   └── container.xml
├── OEBPS
│   ├── Fonts
│   │   └── somefont.otf
│   ├── Images
│   │   ├── ...
│   │   ├── c_wjnter-1.png
│   │   ├── c_wjnter-2.png
│   │   ├── c_wjnter-3.png
│   │   ├── c_wjnter-4.png
│   │   ├── c_wjnter.png
│   │   └── cover.jpg
│   ├── Styles
│   │   └── style.css
│   ├── content.xhtml
│   ├── cover.xhtml
│   ├── songbook.opf
│   └── toc.ncx
└── mimetype
</pre>
 
We use mimetype and container.xml unchanged from ConTeXt’s epub script and (re)create everything else.
At the end this structure is just zipped with an "epub" file ending.
 
== Unchanged files ==
 
For the records:
 
=== {{code|mimetype}} ===
 
<pre>
application/epub+zip
</pre>
 
=== {{code|container.xml}}
 
<xmlcode>
<?xml version="1.0" encoding="UTF-8"?>
 
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
<rootfiles>
<rootfile full-path="OEBPS/songbook.opf" media-type="application/oebps-package+xml"/>
</rootfiles>
</container>
</xmlcode>
== Transform XML to HTML ==
I installed Saxon on my Mac with MacPorts, then instead of just "saxon" you must call {{code|java -jar /opt/local/share/java/saxon9he.jar}}.
This is my === {{code|export2html.xsl}}:===
<xmlcode>
</xmlcode>
=== {{code|style.css}} === Now you have a (hopefully usable) (X)HTML file, you need a {{code|style.css}} CSS for the styling.
A simple example:
Create a {{code|cover.xhtml}}:
 
=== {{code|export2cover.xsl}} ===
<xmlcode>
This file keeps the others together.
 
=== {{code|export2opf.xsl}} ===
<xmlcode>
This one will probably differ from your setup – I (ab)use an index for an alphabetically ordered table of contents.
The structure that ConTeXt outputs for index entries is somewhat uncomfortable...
 
=== {{code|export2ncx.xsl}} ===
<xmlcode>

Navigation menu