docbook-apps

  • 1.  Re: [docbook-apps] I'm want to indent only 'section/para', not 'section/para/programlisting'

    Posted 12-29-2008 17:40
    The problem is that the XSL-FO property text-indent is an inherited
    property. That means it is applied to any fo:block elements contained in
    the para's fo:block. That's why the fo:block containing your programlisting
    text also has that property, even though it doesn't show in the FO file.
    The other complication is that para allows both inline and block elements,
    as well as text, so it can be difficult to sort out how to apply a solution
    to subelements of para.

    You might try this oversimplified solution using fo:wrapper to turn off the
    text-indent for all subelements:

    <xsl:template match="section/para/*">
    <fo:wrapper text-indent="0pt">
    <xsl:apply-imports/>
    </fo:wrapper>
    </xsl:template>

    This wraps any subelement output in an fo:wrapper to reset the text-indent
    property. It then uses xsl:apply-imports to apply the stock DocBook template
    for each subelement. However, if you have a customization of one of those
    subelements, then the apply-imports will ignore that customization and go
    back to the original stock template. So any customized templates for such
    elements must also have this solution. Not pretty, and there are probably
    situations where it won't work properly.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Dongsheng Song" <dongsheng.song@gmail.com>
    To: "DocBook Apps" <docbook-apps@lists.oasis-open.org>
    Sent: Monday, December 29, 2008 1:34 AM
    Subject: [docbook-apps] I'm want to indent only 'section/para', not
    'section/para/programlisting'


    > When I use custom xsl to indent 'section/para':
    >
    > <xsl:attribute-set name="standard.para.spacing"
    > use-attribute-sets="normal.para.spacing">
    > <xsl:attribute name="text-indent">24pt</xsl:attribute>
    > </xsl:attribute-set>
    >
    > <xsl:template match="section/para">
    > <fo:block xsl:use-attribute-sets="standard.para.spacing">
    > <xsl:call-template name="anchor"/>
    > <xsl:apply-templates/>
    > </fo:block>
    > </xsl:template>
    >
    > But 'section/para/programlisting' indent too, how can I avoid it indent
    > any
    > subelements of 'section/para'?
    >
    > Thanks,
    >
    > Dongsheng Song
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >




  • 2.  Re: [docbook-apps] I'm want to indent only 'section/para', not 'section/para/programlisting'

    Posted 12-30-2008 08:04
    Thank you, I make a chinese copy[2] of 'DocBook 5.0: The Definitive Guide'[1],
    It's fine.

    But some page[3] layout is broken, could you give me some advice?

    [1] http://i18n-zh.googlecode.com/files/defguide5-r8198-4cad.pdf
    [2] http://i18n-zh.googlecode.com/files/defguide5-r8198-4cad-zh.pdf
    [3] http://i18n-zh.googlecode.com/files/defguide5-r8198-4cad-zh.png

    2008/12/30 Bob Stayton <bobs@sagehill.net>:
    > The problem is that the XSL-FO property text-indent is an inherited
    > property. That means it is applied to any fo:block elements contained in
    > the para's fo:block. That's why the fo:block containing your programlisting
    > text also has that property, even though it doesn't show in the FO file. The
    > other complication is that para allows both inline and block elements, as
    > well as text, so it can be difficult to sort out how to apply a solution to
    > subelements of para.
    >
    > You might try this oversimplified solution using fo:wrapper to turn off the
    > text-indent for all subelements:
    >
    > <xsl:template match="section/para/*">
    > <fo:wrapper text-indent="0pt">
    > <xsl:apply-imports/>
    > </fo:wrapper>
    > </xsl:template>
    >
    > This wraps any subelement output in an fo:wrapper to reset the text-indent
    > property. It then uses xsl:apply-imports to apply the stock DocBook template
    > for each subelement. However, if you have a customization of one of those
    > subelements, then the apply-imports will ignore that customization and go
    > back to the original stock template. So any customized templates for such
    > elements must also have this solution. Not pretty, and there are probably
    > situations where it won't work properly.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net
    >
    >
    > ----- Original Message ----- From: "Dongsheng Song"
    > <dongsheng.song@gmail.com>
    > To: "DocBook Apps" <docbook-apps@lists.oasis-open.org>
    > Sent: Monday, December 29, 2008 1:34 AM
    > Subject: [docbook-apps] I'm want to indent only 'section/para', not
    > 'section/para/programlisting'
    >
    >
    >> When I use custom xsl to indent 'section/para':
    >>
    >> <xsl:attribute-set name="standard.para.spacing"
    >> use-attribute-sets="normal.para.spacing">
    >> <xsl:attribute name="text-indent">24pt</xsl:attribute>
    >> </xsl:attribute-set>
    >>
    >> <xsl:template match="section/para">
    >> <fo:block xsl:use-attribute-sets="standard.para.spacing">
    >> <xsl:call-template name="anchor"/>
    >> <xsl:apply-templates/>
    >> </fo:block>
    >> </xsl:template>
    >>
    >> But 'section/para/programlisting' indent too, how can I avoid it indent
    >> any
    >> subelements of 'section/para'?
    >>
    >> Thanks,
    >>
    >> Dongsheng Song
    >>
    >> ---------------------------------------------------------------------
    >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >>
    >>
    >>
    >
    >



  • 3.  Website: Incorrect relative links to offsite docs in toc

    Posted 03-14-2009 17:23
    I'm including an offsite document in my Website 2.6.0 layout. However,
    some -generated tocs do not link to it when I specify its location with
    a relative path.

    For example, in this layout the second tocentry specifies an offsite
    document that is to be found in the output-root directory.

    <layout>
    <toc filename="home.html" page="home.xml">

    <tocentry dir="subdir" filename="page.html" page="subdir/page.xml">

    </tocentry>

    <tocentry id="offsite" href="offsite.html">

    </tocentry>

    </toc>
    </layout>

    But in generated pages, the navtoc always links to the offsite document
    using href="offsite.html". So the link is correct in home.html, but
    incorrect in page.html (it should have 'href="../offsite.html"'.

    Looks to me like the problem is in page.uri (in website-common.xsl)
    where it handles offsite tocentry hrefs:

    <xsl:variable name="html.href">
    <xsl:choose>
    <xsl:when test="$href != ''">
    <xsl:value-of select="$href"/>
    </xsl:when>

    Replacing the fourth line with this seems to work ok:

    <xsl:value-of select="concat($relpath,$href)"/>


    Shall I file a bug, or is this user error??

    Thanks,
    Denis

    P.S.: The same problem occurs with Prev and Next buttons if you turn on
    sequential.links. I haven't figured out yet why the fix above doesn't
    fix those links too...