docbook-apps

  • 1.  Re: [docbook] audio epubs

    Posted 09-23-2014 09:16
    [Replying to docbook-apps where this belongs...]
    On 18.9.2014 15:38, Peter Fleck wrote:
    > Is it possible to do a lot of the work to make audio epubs using
    > stylesheets?

    Everything is possible, it depends on effort you can put into it :-)

    > First, how to auto generate ids for each <para>? I'm sure that is
    > straightforward. (Or if more granularity is needed then id's at the
    > sentence or word level as needed).

    Putting following into your customization layer should do the trick:

    <xsl:param name="generate.id.attributes" select="1"/>
    <xsl:param name="generate.consistent.ids" select="1"/>

    <xsl:template name="id.attribute">
    <xsl:param name="node" select="."/>
    <xsl:param name="conditional" select="0"/>
    <xsl:choose>
    <xsl:when test="$generate.id.attributes = 0">

    </xsl:when>
    <xsl:when test="$conditional = 0 or $node/@id or $node/@xml:id">
    <xsl:attribute name="id">
    <xsl:call-template name="object.id">
    <xsl:with-param name="object" select="$node"/>
    </xsl:call-template>
    </xsl:attribute>
    </xsl:when>
    </xsl:choose>
    </xsl:template>

    However if you change your DocBook source autogenerated IDs will change.

    > Second, populate the smil file with the ids
    >
    > <smil xmlns="http://www.w3.org/ns/SMIL"
    > xmlns:epub="http://www.idpf.org/2007/ops" version="3.0">
    >
    > <seq id="id1" epub:textref="index.xhtml" epub:type="bodymatter
    > chapter">
    > <par id="paragraph1">
    > <text src="index.xhtml#para-id1"/>
    >


  • 2.  Re: [docbook] audio epubs

    Posted 09-23-2014 17:13
    Thanks. I look forward to giving this a go.

    Peter
    <skype:peterfleck?call>

    On 23/09/2014 11:15, Jirka Kosek wrote:
    > [Replying to docbook-apps where this belongs...]
    > On 18.9.2014 15:38, Peter Fleck wrote:
    >> Is it possible to do a lot of the work to make audio epubs using
    >> stylesheets?
    > Everything is possible, it depends on effort you can put into it :-)
    >
    >> First, how to auto generate ids for each <para>? I'm sure that is
    >> straightforward. (Or if more granularity is needed then id's at the
    >> sentence or word level as needed).
    > Putting following into your customization layer should do the trick:
    >
    > <xsl:param name="generate.id.attributes" select="1"/>
    > <xsl:param name="generate.consistent.ids" select="1"/>
    >
    > <xsl:template name="id.attribute">
    > <xsl:param name="node" select="."/>
    > <xsl:param name="conditional" select="0"/>
    > <xsl:choose>
    > <xsl:when test="$generate.id.attributes = 0">
    >
    > </xsl:when>
    > <xsl:when test="$conditional = 0 or $node/@id or $node/@xml:id">
    > <xsl:attribute name="id">
    > <xsl:call-template name="object.id">
    > <xsl:with-param name="object" select="$node"/>
    > </xsl:call-template>
    > </xsl:attribute>
    > </xsl:when>
    > </xsl:choose>
    > </xsl:template>
    >
    > However if you change your DocBook source autogenerated IDs will change.
    >
    >> Second, populate the smil file with the ids
    >>
    >> <smil xmlns="http://www.w3.org/ns/SMIL"
    >> xmlns:epub="http://www.idpf.org/2007/ops" version="3.0">
    >>
    >> <seq id="id1" epub:textref="index.xhtml" epub:type="bodymatter
    >> chapter">
    >> <par id="paragraph1">
    >> <text src="index.xhtml#para-id1"/>
    >>