Difference between revisions of "Epub"
m (→Current Issues: - update date) |
(→Current Issues: - WIP table) |
||
Line 129: | Line 129: | ||
<td><code>test.xhtml</code></td> | <td><code>test.xhtml</code></td> | ||
<td>No BODY tag found in content file.</td> | <td>No BODY tag found in content file.</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | |||
+ | <table> | ||
+ | <tr style="background:#cccccc;"> | ||
+ | <td>feature</td> | ||
+ | <td>description</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>id field</td> | ||
+ | <td>sort out id name from specs, [http://code.google.com/p/epubcheck/wiki/Errors xhtml name], [http://idpf.org/epub/30/spec/epub30-ocf.html 3.0 draft], uuid</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>cover</td> | ||
+ | <td>add [http://code.google.com/p/epubcheck/issues/detail?id=74 cover element]</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>toc</td> | ||
+ | <td>table of contents is missing</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>chapter break</td> | ||
+ | <td>new title element → new xhtml</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>ncx file</td> | ||
+ | <td>add dummy ncx file?</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>graphics</td> | ||
+ | <td>include graphics</td> | ||
</tr> | </tr> | ||
</table> | </table> |
Revision as of 11:57, 19 May 2011
ConTeXt has preliminary epub support starting from current 2011.05.18.
In order to make an epub (archive) from your ConTeXt source files, you need to:
- enable the export backend in your
.tex
file or environment file (see Project structure) - call the appropriate
mtxrun
command (with the epub script) shown in the output of a context run or in the log file
Note: There is no support for graphics yet, that will be included in a later version.
Export
To enable the export backend, depending on your needs, one of the following lines has to be included at the beginning of the document (before \starttext).
\setupbackend[export=yes] \setupbackend[export=yes,xhtml=yes] \setupbackend[export=yes,xhtml=whatever.xhtml] \setupbackend[export=yes,css={whatever.css,somemore.css}]
The backend can export into:
- xml
- xhtml
- xhtml+css
For making an epub, you need an xhtml export.
cld-mkvi
It is also possible to hook css into the output, see thread: ntg-context.
Example:
\setupbackend [export=cld-mkiv-export.xml, xhtml=cld-mkiv-export.xhtml, css={cld-mkiv-export.css,mathml.css}]
Mtxrun
The actual generation of the epub can be triggered with the mtxrun
command shown in the output.
Example log entry:
... backend > export > saving xml data in 'oeps.export backend > export > saving css template in 'oeps.template backend > export > saving xhtml variant in 'oeps.xhtml backend > export > saving specification in 'oeps.specification' (mtxrun --script epub --make oeps.specification) ...
The "oeps" will be replaced with the appropriate name given to the export backend.
Therefore, execute:
mtxrun --script epub --make oeps.specification
This will create an oeps.tree folder with an oeps.epub inside it.
More on this on the mailing list, thread starts at: ntg-context.
Example
\setupbackend[export=yes,xhtml=test.xhtml] \starttext Hello world! \stoptext
Tools
Viewer:
Editor:
Validation:
Specification:
Current Issues
As of 02:46, 19 May 2011 (CEST):
tool | description | error |
epubcheck-1.2 | test.epub |
extra field length for first filename must be 0, but was 28 |
epubcheck-1.2 | test.opf :<spine toc="ncx"> |
item with id 'ncx' not found |
epubcheck-1.2 | test.xhtml :document xmlns |
elements from namespace "" are not allowed |
epubreader | test.epub |
This XML file does not appear to have any style information associated with it. |
kindlegen | test.xhtml |
No BODY tag found in content file. |
feature | description |
id field | sort out id name from specs, xhtml name, 3.0 draft, uuid |
cover | add cover element |
toc | table of contents is missing |
chapter break | new title element → new xhtml |
ncx file | add dummy ncx file? |
graphics | include graphics |