| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 | DocBook stylesheets for EPUB 3 output =============================================This directory contains XSL stylesheetsfor generating EPUB3 output from DocBook content.For more information on EPUB3, see:http://idpf.org/epub/30These EPUB3 stylesheets are a customization layer ontop of the xhtml5/ stylesheets in this distribution, whichare in turn a customization layer on top of the xhtml/ stylesheets in this distribution. Using a customization layer enables the EPUB3stylesheets to inherit all the features of theXHTML stylesheets while making the minimum changesfor them to produce valid EPUB3.Usage-----------The general process for creating an EPUB3 ebook is:1.  Generate chunked XHTML5 content that validates againstthe EPUB3 schemas, and generate the EPUB3 packagefiles.2.  Copy any image files into the output directory.3.  Run a zip command to create an .epub file.4.  Validate the .epub file.Following are the steps in more detail.1.  Create the XHTML5 files.-----------------------------The first step is handled by these stylesheets.To generate EPUB3-compatible XHTML5 files,use one of the following stylesheets as you would anyother DocBook XSL stylesheet:epub3/chunk.xsl           - Chunked output.epub3/profile-chunk.xsl   - Profiled chunk output.Although the stylesheet directory contains a docbook.xslstylesheet for single file output, that is not useful forgenerated EPUB3.  You should set the $base.dir stylesheet param to the subdirectory that will contain the .xhtml files andthe epub package files.  Here is an example using xsltproc:xsltproc \  --stringparam base.dir ebook1/OEBPS/  \  epub3/chunk.xsl \  mybook.xmlAfter processing a document with this setting, you should findthe following output:ebook1/mimetype                - required mimetype file.ebook1/META-INF/container.xml  - required container fileebook1/OEBPS/package.opf       - required package fileebook1/OEBPS/toc.ncx           - optional NCX file for backwards compatibilityebook1/OEBPS/docbook-epub.css  - CSS fileebook1/OEBPS/*.xhtml           - The chunked content files.2.  Copy image files---------------------------Manually copy any image files used in the documentinto the corresponding locations in the $base.dirdirectory.  For example, if your document contains:  <imagedata fileref="images/caution.png"/>In this example base.dir, you would copy the file to:  ebook1/OEBPS/images/caution.pngYou can get a list of image files from the manifest filenamed ebook1/OEBPS/package.opf that is created by thestylesheet.  It includes references to image files forcallouts and admonitions if they are used in the output.Note that the header and footer images are turned off forEPUB3 output.3.  Create the epub3 file.-----------------------------Change to the directory containing the base.dir (ebook1in this example), and run the following zip command tocreate the epub file:zip -r -X mybook.epub mimetype META-INF OEBPS The -r option means recursively include all directories.The -X option excludes extra file attributes (required by epub3).The "mybook.epub" in this example is the output file.The other three arguments must appear in this order.4.  Validating with epubcheck 3-----------------------------------There is a java program that can be used to check anepub3 file for conformance.  It is currently available from this website:  http://code.google.com/p/epubcheck/wiki/EPUBCheck30That website provides a download link, and information onhow to run the command.Testing with EPUB readers----------------------------The EPUB3 standard is not yet widely supported.  The output ofthese stylesheets has been tested in the following readers:Apple iBooks on an iPod and iPad.   - Handles videodata and audiodata.   - Does not format MathML yet.   - Handles SVG.Firefox browser with the EPUBReader version 1.4.10 add-on.   - Formats MathML nicely.   - Does not handle videodata or audiodata yet.   - Handles SVG.Ibis EPUB3 preview version   - Does not format MathML yet.   - Does not handle videodata or audiodata yet.   - Handles SVG with external viewer.EPUB metadata========================The info child of the document's root element is usedby the stylesheet to create EPUB metadata.  Note thatmetadata is plain text, so element content is convertedto text using the XSL normalize-space() function.Here is the current mapping of info elements to EPUBmetadata.  Any others are ignored for metadata, butmay appear on the EPUB HTML titlepage, depending on thetitlepage customization.NOTE: the <dc:*> elements (not attributes of meta) duplicatethe meta elements for backwards compatibility, per theEPUB3 specification.  They can be turned off with the $epub.include.optional.metadata.dc.elements parameter.abstract---------The content must be converted to a text string for theOPF metadata. The stylesheet converts only title, para,formalpara, and simpara children in an abstract.  All otherchild elements are ignored.  It puts any title first.The OPF output appears as:<meta property="dcterms:description">title: abstract text</meta><dc:description>title: abstract text</dc:description>author-------If uses a personname child, then it applies theDocBook XSL person.name template to arrange the name.Otherwise processes org or orgname into the content.Then it outputs:<meta id="meta-creator1" property="dcterms:creator">Firstname Surname</meta><dc:creator id="pub-creator1">Firstname Surname</dc:creator>If there are multiple authors, the number in the id attributeis incremented each time.authorgroup-------------Applies templates to all of its children.bibliocoverage---------------<meta property="dcterms:coverage">bibliocoverage text</meta><dc:coverage>bibliocoverage text</dc:coverage>biblioid--------------This usually has @class="isbn" for the ISBN number.  It is usedas the EPUB3 unique-identifier.  That isbn valueis also output as follows:<meta id="meta-identifier" property="dcterms:identifier">urn:isbn:value</meta><dc:identifier id="pub-identifier">urn:isbn:value</dc:identifier>A biblioid element with other class names are converted in a similar manner.bibliorelation----------------<meta property="dcterms:relation">bibliorelation text</meta><dc:relation>bibliorelation text</dc:relation>bibliosource----------------<meta property="dcterms:source">bibliosource text</meta><dc:source>bibliosource text</dc:source>collab------------If a personname child is used, then it calls theperson.name template, otherwise is uses the orgname orcollabname text.<meta property="dcterms:contributor">collab text</meta><dc:contributor>collab text</dc:contributor>copyright-------------Arranges the copyright elements into a text string withcopyright symbol, dates, and holder, and thengenerates:<meta property="dcterms:right">Copyright text</meta><dc:right>Copyright text</dc:right>Also, if there is no info/date element, then the copyrightyear is used to generate:<meta property="dcterms:date">year</meta><dc:date>year</dc:date>corpauthor------------<meta id="meta-creator1" property="dcterms:creator">corpauthor text</meta><dc:creator id="pub-creator1">corpauthor text</dc:creator>corpcredit------------<meta property="dcterms:contributor">corpcredit text</meta><dc:contributor>corpcredit text</dc:contributor>date-------------<meta property="dcterms:date">date text</meta><dc:date>date text</dc:date>See also: copyright.editor--------------If a personname child is used, then it calls theperson.name template, otherwise is uses the orgname text.An editor can be considered as either a creator (when thereis no author) or a contributor.  The stylesheet parameter'editor.property' can be set to either 'creator' or'contributor' (default) at runtime.  So the output is either:<meta property="dcterms:contributor">editor text</meta><dc:contributor>editor text</dc:contributor>or<meta property="dcterms:creator">editor text</meta><dc:creator>editor text</dc:creator>isbn, issn, etc.-----------------Handled like biblioid @class="isbn".keyword-----------<meta property="dcterms:subject">keyword text</meta><dc:subject>keyword text</dc:subject>keywordset------------Applies templates to its children.othercredit------------Handled like collab.pubdate ------------Handled like date.publisher--------------Applies templates only to publishername.publishername---------------<meta property="dcterms:publisher">publishername text</meta><dc:publisher>publishername text</dc:publisher>subjectset--------------Applies templates to subject/subjecterm descendants.subjectterm------------------<meta property="dcterms:subject">subjecterm text</meta><dc:subject>subjecterm text</dc:subject>
 |