[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook-apps] Changing default olink behavior
It occurs to me that I preprocess before generating straight DocBook too, so I should be ok interoperability-wise if I just strip the link text in my preprocess.xsl.
My thinking in doing it this way is that generally I want olinks to behave like xrefs so the link text is always fresh, but that it’s nice to have the title of the target there when you’re editing, even if the title text is potentially stale if the target has changed since you inserted the olink. Another option would be to have the editor’s olink insertion mechanism by default insert the olink link text as a comment, so it would be visible in the editor but not used in rendering.
Anyway, the high-level goal is to have olinks that behave like xrefs, but still give the writer some information about the what the target is (beyond the targetdoc and targetptr values). I’ll have to ponder more what the ideal way to achieve that would actually be.
There is no parameter option to do that. You could customize the template named "olink.hottext" in common/olink.xsl, which generates the link text. That template has grown to be quite large to handle all the options for generating the link text, so you would be copying a big template to your customization layer. In that template is a big xsl:choose, with the first option being to process the content:
You would need to add a condition to that xsl:when's test attribute to get finer control.