]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
doc: epub and mobi support
authorchas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Wed, 8 Jun 2011 14:44:21 +0000 (10:44 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 1 Jul 2011 13:46:30 +0000 (06:46 -0700)
.epub is generated using dbtoepub which is still considered alpha
software apparently and installed in a non-standard place.  for now,
use the docbook stylesheet location to find it.  .mobi is generated
using kindlegen from the .epub in order to have a real toc.

there is some preprocessing with a custom stylesheet to make
things "look right".  see mobi-fixup.xsl.in

Change-Id: Ice92e701e2f921e70c0f98683b5e9ab44a347e3b
Reviewed-on: http://gerrit.openafs.org/4887
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
configure.ac
doc/xml/AdminGuide/Makefile.in
doc/xml/AdminGuide/auagd000.png [new file with mode: 0644]
doc/xml/AdminGuide/auagd000.xml
doc/xml/QuickStartUnix/Makefile.in
doc/xml/QuickStartUnix/auqbg000.png [new file with mode: 0644]
doc/xml/QuickStartUnix/auqbg000.xml
doc/xml/UserGuide/Makefile.in
doc/xml/UserGuide/auusg000.png [new file with mode: 0644]
doc/xml/UserGuide/auusg000.xml
doc/xml/mobi-fixup.xsl.in [new file with mode: 0644]

index 0aa3dba5fc737cec96939393e6a3ee5614ec24ee..764165ea6b1eda9d92570401fd4954345404deba 100644 (file)
@@ -105,6 +105,11 @@ if test -f 'doc/xml/UserGuide/Makefile.in' ; then
 else
    USERGUIDE_MAKEFILE=
 fi
+if test -f 'doc/xml/mobi-fixup.xsl.in' ; then
+   MOBI_FIXUP_XSL="doc/xml/mobi-fixup.xsl"
+else
+   MOBI_FIXUP_XSL=
+fi
 
 AC_OUTPUT(             \
 Makefile               \
@@ -112,6 +117,7 @@ ${MAN_MAKEFILE} \
 ${ADMINGUIDE_MAKEFILE} \
 ${QSUNIX_MAKEFILE} \
 ${USERGUIDE_MAKEFILE} \
+${MOBI_FIXUP_XSL} \
 src/afs/Makefile \
 src/afsd/Makefile \
 src/afsmonitor/Makefile \
index cbbba59a9f1629f7565035f29b43a71f962a41f8..33d0dc86b86d3008ca04462d1ef4ed4a0270acc9 100644 (file)
@@ -15,7 +15,7 @@
 
 BOOK = auagd000
 
-all: $(BOOK).pdf index.html
+all: $(BOOK).pdf index.html $(BOOK).epub $(BOOK).mobi
 
 include @TOP_OBJDIR@/src/config/Makefile.config
 VERSION=version
@@ -30,6 +30,7 @@ HTML_XSL = @HTML_XSL@
 DOCBOOK_STYLESHEETS = @DOCBOOK_STYLESHEETS@
 XSLTPROC = @XSLTPROC@
 DOCBOOK2PDF = @DOCBOOK2PDF@
+DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub
 
 index.html: $(SRCS)
        $(XSLTPROC) --param navig.graphics 1 \
@@ -43,6 +44,14 @@ $(BOOK).pdf: $(SRCS)
                $(DOCBOOK2PDF) $(BOOK).xml; \
        fi
 
+$(BOOK).epub: $(SRCS)
+       if test -x "$(DBTOEPUB)" ; then \
+               $(DBTOEPUB) -s $(TOP_SRCDIR)/../doc/xml/mobi-fixup.xsl $(BOOK).xml; \
+       fi
+
+$(BOOK).mobi: $(BOOK).epub
+       kindlegen $(BOOK).epub -o $(BOOK).mobi
+
 check:
        xmllint --noout --valid $(BOOK).xml
 
diff --git a/doc/xml/AdminGuide/auagd000.png b/doc/xml/AdminGuide/auagd000.png
new file mode 100644 (file)
index 0000000..344ab25
Binary files /dev/null and b/doc/xml/AdminGuide/auagd000.png differ
index 92c1441e28c3ef0584a605b08a08e322fc4e4129..5946bb0c6ee46a0440c44dd067981580d77e7b86 100644 (file)
   <bookinfo>
     <title>OpenAFS Administration Guide</title>
 
+    <mediaobject role="cover">
+      <imageobject>
+        <imagedata fileref="auagd000.png" />
+      </imageobject>
+    </mediaobject>
+
     <copyright>
       <year>2000</year>
 
index 229e2642c45a90988e139341a0df8af941772437..73516453f5f36e9b618eded3925877a83d73113f 100644 (file)
@@ -15,7 +15,7 @@
 
 BOOK = auqbg000
 
-all: $(BOOK).pdf index.html
+all: $(BOOK).pdf index.html $(BOOK).epub $(BOOK).mobi
 
 include @TOP_OBJDIR@/src/config/Makefile.config
 VERSION=version
@@ -28,6 +28,7 @@ HTML_XSL = @HTML_XSL@
 DOCBOOK_STYLESHEETS = @DOCBOOK_STYLESHEETS@
 XSLTPROC = @XSLTPROC@
 DOCBOOK2PDF = @DOCBOOK2PDF@
+DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub
 
 index.html: $(SRCS)
        $(XSLTPROC) --param navig.graphics 1 \
@@ -41,6 +42,14 @@ $(BOOK).pdf: $(SRCS)
                $(DOCBOOK2PDF) $(BOOK).xml; \
        fi
 
+$(BOOK).epub: $(SRCS)
+       if test -x "$(DBTOEPUB)" ; then \
+               $(DBTOEPUB) -s $(TOP_SRCDIR)/../doc/xml/mobi-fixup.xsl $(BOOK).xml; \
+       fi
+
+$(BOOK).mobi: $(BOOK).epub
+       kindlegen $(BOOK).epub -o $(BOOK).mobi
+
 check:
        xmllint --noout --valid $(BOOK).xml
 
diff --git a/doc/xml/QuickStartUnix/auqbg000.png b/doc/xml/QuickStartUnix/auqbg000.png
new file mode 100644 (file)
index 0000000..941cd3e
Binary files /dev/null and b/doc/xml/QuickStartUnix/auqbg000.png differ
index a7993c22b485e49937b7ed33956c0d4108994b99..13b376ed3b261b343ef994a9e57198891d6d609b 100644 (file)
   <bookinfo>
     <title>OpenAFS Quick Start Guide for UNIX</title>
 
+    <mediaobject role="cover">
+      <imageobject>
+        <imagedata fileref="auqbg000.png" />
+      </imageobject>
+    </mediaobject>
+
     <copyright>
       <year>2000-2009</year>
       <holder>IBM Corporation and other contributors. All Rights Reserved</holder>
index 725959c981e441dbbf6b4b85b0285e377fa484e8..4757ccd92b920deb3e35581b3cb5431fd606cbca 100644 (file)
@@ -15,7 +15,7 @@
 
 BOOK = auusg000
 
-all: $(BOOK).pdf index.html
+all: $(BOOK).pdf index.html $(BOOK).epub $(BOOK).mobi
 
 include @TOP_OBJDIR@/src/config/Makefile.config
 VERSION=version
@@ -41,6 +41,14 @@ $(BOOK).pdf: $(SRCS)
                $(DOCBOOK2PDF) $(BOOK).xml; \
        fi
 
+$(BOOK).epub: $(SRCS)
+       if test -x "$(DBTOEPUB)" ; then \
+               $(DBTOEPUB) -s $(TOP_SRCDIR)/../doc/xml/mobi-fixup.xsl $(BOOK).xml; \
+       fi
+
+$(BOOK).mobi: $(BOOK).epub
+       kindlegen $(BOOK).epub -o $(BOOK).mobi
+
 check:
        xmllint --noout --valid $(BOOK).xml
 
diff --git a/doc/xml/UserGuide/auusg000.png b/doc/xml/UserGuide/auusg000.png
new file mode 100644 (file)
index 0000000..c9b17cc
Binary files /dev/null and b/doc/xml/UserGuide/auusg000.png differ
index cbd0fd8225f1796f6e7c3f6fe71d8ae00bc5135d..ffb965045bec72a03ccb925799b0a6060e89dc27 100644 (file)
   <bookinfo>
     <title>OpenAFS User Guide</title>
 
+    <mediaobject role="cover">
+      <imageobject>
+        <imagedata fileref="auusg000.png" />
+      </imageobject>
+    </mediaobject>
+
     <copyright>
       <year>2000</year>
 
diff --git a/doc/xml/mobi-fixup.xsl.in b/doc/xml/mobi-fixup.xsl.in
new file mode 100644 (file)
index 0000000..8e33521
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+
+<!--
+     The kindle seems to render certain lists with an extra line break.
+     To work around this for now, we remove the first <para> for itemized
+     and ordered lists.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+    <xsl:import href="@DOCBOOK_STYLESHEETS@/epub/docbook.xsl"/>
+
+    <xsl:template match="/">
+       <xsl:copy>
+           <xsl:apply-imports/>
+       </xsl:copy>
+    </xsl:template>
+
+
+    <xsl:template match="itemizedlist/listitem/para[position() = 1]">
+        <!-- still process any anchors embedded in the <listitem> -->
+        <xsl:call-template name="anchor">
+            <xsl:with-param name="node" select="parent::listitem"/>
+        </xsl:call-template>
+       <xsl:apply-templates/>
+    </xsl:template>
+
+    <xsl:template match="orderedlist/listitem/para[position() = 1]">
+        <!-- still process any anchors embedded in the <listitem> -->
+        <xsl:call-template name="anchor">
+            <xsl:with-param name="node" select="parent::listitem"/>
+        </xsl:call-template>
+       <xsl:apply-templates/>
+    </xsl:template>
+
+</xsl:stylesheet>