source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/epub3/README@ 64a2cd5

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 64a2cd5 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 8.7 KB
Line 
1DocBook stylesheets for EPUB 3 output
2=============================================
3
4This directory contains XSL stylesheets
5for generating EPUB3 output from DocBook content.
6For more information on EPUB3, see:
7
8http://idpf.org/epub/30
9
10These EPUB3 stylesheets are a customization layer on
11top of the xhtml5/ stylesheets in this distribution, which
12are in turn a customization layer on top of the
13xhtml/ stylesheets in this distribution.
14Using a customization layer enables the EPUB3
15stylesheets to inherit all the features of the
16XHTML stylesheets while making the minimum changes
17for them to produce valid EPUB3.
18
19Usage
20-----------
21The general process for creating an EPUB3 ebook is:
22
231. Generate chunked XHTML5 content that validates against
24the EPUB3 schemas, and generate the EPUB3 package
25files.
26
272. Copy any image files into the output directory.
28
293. Run a zip command to create an .epub file.
30
314. Validate the .epub file.
32
33
34Following are the steps in more detail.
35
361. Create the XHTML5 files.
37-----------------------------
38
39The first step is handled by these stylesheets.
40To generate EPUB3-compatible XHTML5 files,
41use one of the following stylesheets as you would any
42other DocBook XSL stylesheet:
43
44epub3/chunk.xsl - Chunked output.
45epub3/profile-chunk.xsl - Profiled chunk output.
46
47Although the stylesheet directory contains a docbook.xsl
48stylesheet for single file output, that is not useful for
49generated EPUB3.
50
51You should set the $base.dir stylesheet param to the
52subdirectory that will contain the .xhtml files and
53the epub package files. Here is an example using xsltproc:
54
55xsltproc \
56 --stringparam base.dir ebook1/OEBPS/ \
57 epub3/chunk.xsl \
58 mybook.xml
59
60After processing a document with this setting, you should find
61the following output:
62
63ebook1/mimetype - required mimetype file.
64ebook1/META-INF/container.xml - required container file
65ebook1/OEBPS/package.opf - required package file
66ebook1/OEBPS/toc.ncx - optional NCX file for backwards compatibility
67ebook1/OEBPS/docbook-epub.css - CSS file
68ebook1/OEBPS/*.xhtml - The chunked content files.
69
70
712. Copy image files
72---------------------------
73
74Manually copy any image files used in the document
75into the corresponding locations in the $base.dir
76directory. For example, if your document contains:
77
78 <imagedata fileref="images/caution.png"/>
79
80In this example base.dir, you would copy the file to:
81
82 ebook1/OEBPS/images/caution.png
83
84You can get a list of image files from the manifest file
85named ebook1/OEBPS/package.opf that is created by the
86stylesheet. It includes references to image files for
87callouts and admonitions if they are used in the output.
88Note that the header and footer images are turned off for
89EPUB3 output.
90
91
923. Create the epub3 file.
93-----------------------------
94Change to the directory containing the base.dir (ebook1
95in this example), and run the following zip command to
96create the epub file:
97
98zip -r -X mybook.epub mimetype META-INF OEBPS
99
100The -r option means recursively include all directories.
101The -X option excludes extra file attributes (required by epub3).
102The "mybook.epub" in this example is the output file.
103The other three arguments must appear in this order.
104
105
1064. Validating with epubcheck 3
107-----------------------------------
108
109There is a java program that can be used to check an
110epub3 file for conformance. It is currently available
111from this website:
112
113 http://code.google.com/p/epubcheck/wiki/EPUBCheck30
114
115That website provides a download link, and information on
116how to run the command.
117
118
119Testing with EPUB readers
120----------------------------
121The EPUB3 standard is not yet widely supported. The output of
122these stylesheets has been tested in the following readers:
123
124Apple iBooks on an iPod and iPad.
125 - Handles videodata and audiodata.
126 - Does not format MathML yet.
127 - Handles SVG.
128
129Firefox browser with the EPUBReader version 1.4.10 add-on.
130 - Formats MathML nicely.
131 - Does not handle videodata or audiodata yet.
132 - Handles SVG.
133
134Ibis EPUB3 preview version
135 - Does not format MathML yet.
136 - Does not handle videodata or audiodata yet.
137 - Handles SVG with external viewer.
138
139
140EPUB metadata
141========================
142The info child of the document's root element is used
143by the stylesheet to create EPUB metadata. Note that
144metadata is plain text, so element content is converted
145to text using the XSL normalize-space() function.
146
147Here is the current mapping of info elements to EPUB
148metadata. Any others are ignored for metadata, but
149may appear on the EPUB HTML titlepage, depending on the
150titlepage customization.
151
152NOTE: the <dc:*> elements (not attributes of meta) duplicate
153the meta elements for backwards compatibility, per the
154EPUB3 specification. They can be turned off with the
155$epub.include.optional.metadata.dc.elements parameter.
156
157abstract
158---------
159The content must be converted to a text string for the
160OPF metadata. The stylesheet converts only title, para,
161formalpara, and simpara children in an abstract. All other
162child elements are ignored. It puts any title first.
163The OPF output appears as:
164
165<meta property="dcterms:description">title: abstract text</meta>
166<dc:description>title: abstract text</dc:description>
167
168
169author
170-------
171If uses a personname child, then it applies the
172DocBook XSL person.name template to arrange the name.
173Otherwise processes org or orgname into the content.
174Then it outputs:
175
176<meta id="meta-creator1" property="dcterms:creator">Firstname Surname</meta>
177<dc:creator id="pub-creator1">Firstname Surname</dc:creator>
178
179If there are multiple authors, the number in the id attribute
180is incremented each time.
181
182
183authorgroup
184-------------
185Applies templates to all of its children.
186
187
188bibliocoverage
189---------------
190<meta property="dcterms:coverage">bibliocoverage text</meta>
191<dc:coverage>bibliocoverage text</dc:coverage>
192
193
194biblioid
195--------------
196This usually has @class="isbn" for the ISBN number. It is used
197as the EPUB3 unique-identifier. That isbn value
198is also output as follows:
199
200<meta id="meta-identifier" property="dcterms:identifier">urn:isbn:value</meta>
201<dc:identifier id="pub-identifier">urn:isbn:value</dc:identifier>
202
203A biblioid element with other class names are converted in a similar manner.
204
205
206bibliorelation
207----------------
208<meta property="dcterms:relation">bibliorelation text</meta>
209<dc:relation>bibliorelation text</dc:relation>
210
211
212bibliosource
213----------------
214<meta property="dcterms:source">bibliosource text</meta>
215<dc:source>bibliosource text</dc:source>
216
217
218collab
219------------
220If a personname child is used, then it calls the
221person.name template, otherwise is uses the orgname or
222collabname text.
223
224<meta property="dcterms:contributor">collab text</meta>
225<dc:contributor>collab text</dc:contributor>
226
227
228copyright
229-------------
230Arranges the copyright elements into a text string with
231copyright symbol, dates, and holder, and then
232generates:
233
234<meta property="dcterms:right">Copyright text</meta>
235<dc:right>Copyright text</dc:right>
236
237Also, if there is no info/date element, then the copyright
238year is used to generate:
239
240<meta property="dcterms:date">year</meta>
241<dc:date>year</dc:date>
242
243
244corpauthor
245------------
246<meta id="meta-creator1" property="dcterms:creator">corpauthor text</meta>
247<dc:creator id="pub-creator1">corpauthor text</dc:creator>
248
249
250corpcredit
251------------
252<meta property="dcterms:contributor">corpcredit text</meta>
253<dc:contributor>corpcredit text</dc:contributor>
254
255
256date
257-------------
258<meta property="dcterms:date">date text</meta>
259<dc:date>date text</dc:date>
260
261See also: copyright.
262
263
264editor
265--------------
266If a personname child is used, then it calls the
267person.name template, otherwise is uses the orgname text.
268
269An editor can be considered as either a creator (when there
270is no author) or a contributor. The stylesheet parameter
271'editor.property' can be set to either 'creator' or
272'contributor' (default) at runtime. So the output is either:
273
274<meta property="dcterms:contributor">editor text</meta>
275<dc:contributor>editor text</dc:contributor>
276
277or
278
279<meta property="dcterms:creator">editor text</meta>
280<dc:creator>editor text</dc:creator>
281
282
283isbn, issn, etc.
284-----------------
285Handled like biblioid @class="isbn".
286
287
288keyword
289-----------
290<meta property="dcterms:subject">keyword text</meta>
291<dc:subject>keyword text</dc:subject>
292
293
294keywordset
295------------
296Applies templates to its children.
297
298
299othercredit
300------------
301Handled like collab.
302
303
304pubdate
305------------
306Handled like date.
307
308
309publisher
310--------------
311Applies templates only to publishername.
312
313
314publishername
315---------------
316<meta property="dcterms:publisher">publishername text</meta>
317<dc:publisher>publishername text</dc:publisher>
318
319
320subjectset
321--------------
322Applies templates to subject/subjecterm descendants.
323
324
325subjectterm
326------------------
327<meta property="dcterms:subject">subjecterm text</meta>
328<dc:subject>subjecterm text</dc:subject>
329
Note: See TracBrowser for help on using the repository browser.