[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] why doesn't DB have an element for context breaks?
Hi On 19/02/17 09:47, Martin Doucha wrote:
Dne 18.2.2017 v 23:23 Robert Nagle napsal(a):I publish a lot of literary titles as epubs using docbook. One thing I encounter frequently (10+ times a publication usually) are narrative breaks in the middle of a chapter. Sometimes it's extra space to denote the passage of time or maybe a change in point of view. Sometimes it means adding decorative things (asterisks etc) in this space. I personally don't use these things a lot when writing content, but a lot of prose authors do.Docbook templates could use a lot of improvements, not just more features but also refactoring for easier customization. Here's how I've solved the same problem. I've added a small template which will generate a separator at the beginning of every section with no title: <xsl:template match="d:section|d:sect1|d:sect2|d:sect3|d:sect4|d:sect5"> <xsl:if test="not(d:title|d:info/d:title)"> <div class="nameless-section-sep"> <xsl:text>* * *</xsl:text> </div> </xsl:if> <xsl:apply-imports/> </xsl:template> Don't forget to set appropriate margins and text centering in your CSS style sheet and then simply wrap the text following the desired narrative break in the <section> tag.
Martin, doesn't that mean you would have to customize the DocBook schema to allow sections with no titles?
Robert, if you don't want to customize the DocBook schema, maybe you could use an empty bridgehead element for this kind of context break, perhaps something like <bridgehead renderas="other" otherrenderas="hr" />. I'll admit it's not the best semantic fit.
You could adapt Martin's custom template accordingly, something like, <xsl:template match="d:bridgehead[@otherrenderas='hr']"> <div class="nameless-section-sep"> <xsl:text>* * *</xsl:text> </div> </xsl:template> Although n.b. I haven't tested this. -- Simon Dew email@example.com http://janiveer.github.io