doc: epub and mobi support

.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>
This commit is contained in:
chas williams - CONTRACTOR 2011-06-08 10:44:21 -04:00 committed by Derrick Brashear
parent 31a001f60e
commit 9929d1c6fc
11 changed files with 89 additions and 3 deletions

View 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 \

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -28,6 +28,12 @@
<bookinfo>
<title>OpenAFS Administration Guide</title>
<mediaobject role="cover">
<imageobject>
<imagedata fileref="auagd000.png" />
</imageobject>
</mediaobject>
<copyright>
<year>2000</year>

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -16,6 +16,12 @@
<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>

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -18,6 +18,12 @@
<bookinfo>
<title>OpenAFS User Guide</title>
<mediaobject role="cover">
<imageobject>
<imagedata fileref="auusg000.png" />
</imageobject>
</mediaobject>
<copyright>
<year>2000</year>

36
doc/xml/mobi-fixup.xsl.in Normal file
View File

@ -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>