docbook-apps

  • 1.  RE: [docbook-apps] Producing an arbitrary chunk in epub

    Posted 08-15-2012 18:05
    The older epub (for now).

    From: Bob Stayton [mailto:bobs@sagehill.net]
    Sent: Wednesday, August 15, 2012 1:04 PM
    To: Jason Zech; DocBook Apps
    Subject: Re: [docbook-apps] Producing an arbitrary chunk in epub

    Are you using the epub or epub3 stylesheets in DocBook XSL? They are structured differently for customizations.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net<mailto:bobs@sagehill.net>





  • 2.  RE: [docbook-apps] Producing an arbitrary chunk in epub

    Posted 08-15-2012 21:36
    I was able to get it working. The problem is that I hadn't included the path in the output chunk's generated filename. It was getting made but not put into the epub or anywhere near it.

    I was able to get a separate copyright chunk with legal notices by adding <xsl:call-template name="copyright.chunk"/> to the root template at the same time as the call to the opf, ncx, etc templates and adding templates below to my customization layer (the main/chunking one). I still need to true up the manifest and spine to get it in there, but it seems to be working.

    <xsl:template name="copyright.chunk">
    <xsl:apply-templates select="/*/*[contains(name(.), 'info')]"/>
    </xsl:template>

    <xsl:template match="/*/*[contains(name(.), 'info')]">
    <xsl:variable name="copyright.filename" select="concat($epub.oebps.dir, 'copyright', $html.ext)"/>
    <xsl:call-template name="write.chunk">
    <xsl:with-param name="filename">
    <xsl:value-of select="$copyright.filename" />
    </xsl:with-param>
    <xsl:with-param name="method" select="'xml'" />
    <xsl:with-param name="encoding" select="'utf-8'" />
    <xsl:with-param name="indent" select="'yes'" />
    <xsl:with-param name="quiet" select="$chunk.quietly" />
    <xsl:with-param name="content">



    <xsl:call-template name="output.html.stylesheets">
    <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
    </xsl:call-template>


    <xsl:call-template name="body.attributes"/>

    <xsl:attribute name="class">copyright</xsl:attribute>
    <xsl:if test="d:copyright">
    <xsl:apply-templates select="d:copyright" mode="titlepage.mode"/>
    </xsl:if>

    <xsl:if test="d:legalnotice">
    <xsl:apply-templates select="d:legalnotice" mode="titlepage.mode"/>
    </xsl:if>



    </xsl:with-param>
    </xsl:call-template>
    </xsl:template>


    From: Jason Zech [mailto:zech@loyolapress.com]
    Sent: Wednesday, August 15, 2012 1:06 PM
    To: Bob Stayton; DocBook Apps
    Subject: RE: [docbook-apps] Producing an arbitrary chunk in epub

    The older epub (for now).

    From: Bob Stayton [mailto:bobs@sagehill.net]
    Sent: Wednesday, August 15, 2012 1:04 PM
    To: Jason Zech; DocBook Apps
    Subject: Re: [docbook-apps] Producing an arbitrary chunk in epub

    Are you using the epub or epub3 stylesheets in DocBook XSL?  They are structured differently for customizations.
     
    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net
     
     



  • 3.  Re: [docbook-apps] Producing an arbitrary chunk in epub

    Posted 08-18-2012 00:08
    This looks promising - I've been looking for this functionality in EPUB
    for a while now. I'll try it out shortly once I migrate my
    customizations to EPUB 3.
    Dave

    On 16-08-12 7:36 AM, Jason Zech wrote:
    > I was able to get it working. The problem is that I hadn't included the path in the output chunk's generated filename. It was getting made but not put into the epub or anywhere near it.
    >
    > I was able to get a separate copyright chunk with legal notices by adding<xsl:call-template name="copyright.chunk"/> to the root template at the same time as the call to the opf, ncx, etc templates and adding templates below to my customization layer (the main/chunking one). I still need to true up the manifest and spine to get it in there, but it seems to be working.
    >
    > <xsl:template name="copyright.chunk">
    > <xsl:apply-templates select="/*/*[contains(name(.), 'info')]"/>
    > </xsl:template>
    >
    > <xsl:template match="/*/*[contains(name(.), 'info')]">
    > <xsl:variable name="copyright.filename" select="concat($epub.oebps.dir, 'copyright', $html.ext)"/>
    > <xsl:call-template name="write.chunk">
    > <xsl:with-param name="filename">
    > <xsl:value-of select="$copyright.filename" />
    > </xsl:with-param>
    > <xsl:with-param name="method" select="'xml'" />
    > <xsl:with-param name="encoding" select="'utf-8'" />
    > <xsl:with-param name="indent" select="'yes'" />
    > <xsl:with-param name="quiet" select="$chunk.quietly" />
    > <xsl:with-param name="content">
    >
    >
    >
    > <xsl:call-template name="output.html.stylesheets">
    > <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
    > </xsl:call-template>
    >
    >
    > <xsl:call-template name="body.attributes"/>
    >

    > <xsl:attribute name="class">copyright</xsl:attribute>
    > <xsl:if test="d:copyright">
    > <xsl:apply-templates select="d:copyright" mode="titlepage.mode"/>
    > </xsl:if>
    >
    > <xsl:if test="d:legalnotice">
    > <xsl:apply-templates select="d:legalnotice" mode="titlepage.mode"/>
    > </xsl:if>
    >

    >
    >
    > </xsl:with-param>
    > </xsl:call-template>
    > </xsl:template>
    >
    >
    > From: Jason Zech [mailto:zech@loyolapress.com]
    > Sent: Wednesday, August 15, 2012 1:06 PM
    > To: Bob Stayton; DocBook Apps
    > Subject: RE: [docbook-apps] Producing an arbitrary chunk in epub
    >
    > The older epub (for now).
    >
    > From: Bob Stayton [mailto:bobs@sagehill.net]
    > Sent: Wednesday, August 15, 2012 1:04 PM
    > To: Jason Zech; DocBook Apps
    > Subject: Re: [docbook-apps] Producing an arbitrary chunk in epub
    >
    > Are you using the epub or epub3 stylesheets in DocBook XSL? They are structured differently for customizations.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net
    >
    >
    >