OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: relative links in roff man pages


I see these in the generated clisp manpages <http://clisp.podval.org/clisp.1> 
(in the NOTES section):

         2. read-eval-print loop
            [set $man.base.url.for.relative.links]/sec_25-1-1

        10. SYMBOL-MACRO
            [set $man.base.url.for.relative.links]/mac_define-symbol-macro

        12. environment variable
            [set $man.base.url.for.relative.links]/basedefs/xbd_chap08.html

        17. continuable
            [set $man.base.url.for.relative.links]/clhs/glo

        29. "COMMON-LISP-USER"
            [set $man.base.url.for.relative.links]/sec_11-1-2-2

        43. #'
            [set $man.base.url.for.relative.links]/sec_2-4-8-2

        44. #P
            [set $man.base.url.for.relative.links]/sec_2-4-8-14

not many, but unpleasant, so I would like to fix them.
clearly $man.base.url.for.relative.links is not appropriate because items 12 
has a different base URL. (yes, I read
http://docbook.xml-doc.org/snapshots/xsl/doc/manpages/man.base.url.for.relative.links.html)

these notes come from elements like these:

<ulink role="clhs" url="sec_25-1-1">read-eval-print loop</ulink>
<ulink role="unix" url="basedefs/xbd_chap08.html">environment variable</ulink>
<ulink role="clhs" url="sec_2-4-8-2"><literal role="data">#&#39;</literal></ulink>

which are handled for html by these customizations:

<xsl:template match="ulink[@role='unix']">
  <a class="{@role}" href="{$unix.top}{@url}"><xsl:apply-templates/></a>
</xsl:template>

and

<xsl:template match="ulink[@role='clhs']">
  <xsl:choose><xsl:when test=".=''">
    <a class="{@role}" href="{$clhs.body}{@url}.html"><xsl:text>[</xsl:text>
     <xsl:value-of select="@url"/>
     <xsl:text>]</xsl:text></a></xsl:when>
   <xsl:otherwise>
    <a class="{@role}" href="{$clhs.body}{@url}.html"><xsl:apply-templates/></a>
</xsl:otherwise></xsl:choose></xsl:template>

<xsl:template match="ulink[@url='clhs/glo']">
  <a class="{@role}" 
href="{$clhs.body}glo_{substring(.,1,1)}.html#{translate(normalize-space(.),' 
','_')}">
   <xsl:apply-templates/></a></xsl:template>

I wonder how I could adapt these for man pages - what I want to see is 
something like

         2. read-eval-print loop
            http://www.lisp.org/HyperSpec/sec_25-1-1.html

        10. SYMBOL-MACRO
            http://www.lisp.org/HyperSpec/mac_define-symbol-macro.html

        12. environment variable
            /basedefs/xbd_chap08.html

        17. continuable
            http://www.lisp.org/HyperSpec/clhs/glo_c.html

        29. "COMMON-LISP-USER"
            http://www.lisp.org/HyperSpec/sec_11-1-2-2.html

        43. #'
            http://www.lisp.org/HyperSpec/sec_2-4-8-2.html

        44. #P
            http://www.lisp.org/HyperSpec/sec_2-4-8-14.html

The ideal would, of course, be to convert

<ulink role="clhs" url="sec_25-1-1">read-eval-print loop</ulink>

to

<ulink url="http://www.lisp.org/HyperSpec/sec_25-1-1.html";>read-eval-print 
loop</ulink>

and then apply the normal templates, but, as I have been told over and over and 
over again, this would require multiple passes or profiling, and I do not wish 
to go that way (at least not yet).

a lispy approach would be to _bind_ $man.base.url.for.relative.links around 
applying the man templates, but I don't know how to do that. Is is feasible?

Thanks
Sam



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]