[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] creating clickable titles
Thanks for that. I'll have a look at it, and yes I do have a customisation layer. I'll also look into the web help format.On Thu, Feb 13, 2014 at 3:02 AM, Peter Desjardins <email@example.com> wrote:[switching to docbook-apps list]
That use case sounds reasonable, although in my opinion making
headings links to themselves sounds a little confusing to users. I
typically use the webhelp output format instead of direct HTML so my
output displays the TOC on every page. It's easy for me to copy the
URL for any page from that TOC.
To do what you are describing, I would start by taking a look at the
section.heading template in the html/sections.xsl file. Here's a
snippet from that template:
<xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
<xsl:if test="$css.decoration != '0'">
<xsl:attribute name="style">clear: both</xsl:attribute>
<xsl:if test="$allow-anchors != 0">
<xsl:with-param name="node" select="$section"/>
<xsl:with-param name="conditional" select="0"/>
The line <xsl:copy-of select="$title"/> enters the text of the
heading. You could experiment with adding an <xsl:element
name="a"><xsl:attribute name="href"> enclosure around that xsl:copy
You'd have to get the ID of the parent section in order to complete
the href attribute. That should be available from the $section
parameter of the template. But the way you get the ID depends on how
your source DocBook is formed.
Also, this would not affect chapter titles. You'd need to hunt down
the template that writes chapter headings and do something similar.
You'll need to get a little intimate with the XSLT in order to do this
my way. I am assuming you already have a customization layer
Maybe someone has a simpler solution.
Hope this helps.
On Tue, Feb 11, 2014 at 11:53 PM, natk <firstname.lastname@example.org> wrote:
> The use-case for this is you're reading the document, and you want to
> communicate a particular spot in the document to someone else. You click on
> the document, and that gives you the URL (document#anchor) to send.
> On Wed, Feb 12, 2014 at 3:48 PM, Peter Desjardins
> <email@example.com> wrote:
>> Typically, this sort of question should go to
>> firstname.lastname@example.org because it is about publishing tools
>> rather than the XML source.
>> I can image writing customization code that would do this. It doesn't
>> look too difficult once you find the template that writes the
>> But I'm curious about the intent. Do you want to make each heading a
>> link to itself? I don't understand how that would be useful.
>> Maybe I am not understanding what you are trying to accomplish?
>> On Tue, Feb 11, 2014 at 10:36 PM, natk <email@example.com> wrote:
>> > Hi,
>> > I wondered if there is any way of creating clickable titles in the HTML
>> > output of docbook.
>> > The output would look something like:
>> > <h1 id="title"><a href=""> >> >
>> > The reason for doing this would be to be able to identify and
>> > communicate
>> > particular sections of a document.
>> > Nat