1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Callouts -->
<xsl:template match="*[local-name() = 'co']">
<xsl:value-of select="concat('\','fB(',substring-after(@id,'-'),')','\','fR')"/>
</xsl:template>
<xsl:template match="*[local-name() = 'calloutlist']">
<xsl:value-of select="."/>
<xsl:text>sp </xsl:text>
<xsl:apply-templates/>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="*[local-name() = 'callout']">
<xsl:value-of select="concat('\','fB',substring-after(@arearefs,'-'),'. ','\','fR')"/>
<xsl:apply-templates/>
<xsl:value-of select="."/>
<xsl:text>br </xsl:text>
</xsl:template>
<!-- Links -->
<xsl:template match="*[local-name() = 'ulink']">
<xsl:apply-templates/><xsl:text> <</xsl:text><xsl:value-of select="@url"/><xsl:text>></xsl:text>
</xsl:template>
<!-- Literal -->
<xsl:template match="*[local-name() = 'literal']">
<xsl:text>\fB</xsl:text>
<xsl:value-of select="." />
<xsl:text>\fR</xsl:text>
</xsl:template>
<!--
Make admonitions look like this:
Some paragraph.
Note
Sit sed culpa elit dolore esse irure dolor amet magna
veniam elit ut.
Duis adipisicing magna quis in in in reprehenderit
proident minim cupidatat dolore sit minim deserunt duis dolore ex ea.
Next paragraph.
instead of:
Some paragraph.
Note
Sit sed culpa elit dolore esse irure dolor amet magna
veniam elit ut.
Duis adipisicing magna quis in in in reprehenderit
proident minim cupidatat dolore sit minim deserunt duis
dolore ex ea.
Next paragraph.
This looks better when, for example, you put a note immediately
after a list:
Ambiguous:
• Some list item.
• Some other list item.
Note
Does this note apply to the last list item or to the
previous block?
Clear:
• Some list item.
• Some other list item.
Note
This note applies to the previous block.
-->
<xsl:template match="caution|important|note|tip|warning">
<xsl:call-template name="roff-if-start">
<xsl:with-param name="condition">n</xsl:with-param>
</xsl:call-template>
<xsl:text>.sp </xsl:text>
<xsl:call-template name="roff-if-end"/>
<xsl:if test="not($man.output.better.ps.enabled = 0)">
<xsl:text>.BM yellow </xsl:text>
</xsl:if>
<xsl:call-template name="pinch.together"/>
<xsl:text>.ps +1 </xsl:text>
<xsl:call-template name="make.bold.title"/>
<xsl:text>.ps -1 </xsl:text>
<xsl:text>.br </xsl:text>
<xsl:text>.RS 4 </xsl:text>
<xsl:apply-templates/>
<xsl:text>.sp .5v </xsl:text>
<xsl:if test="not($man.output.better.ps.enabled = 0)">
<xsl:text>.EM yellow </xsl:text>
</xsl:if>
<xsl:text>.RE </xsl:text>
</xsl:template>
<!-- Disable end notes -->
<xsl:param name="man.endnotes.are.numbered">0</xsl:param>
<!-- Disable hyphenation, except for URLs -->
<xsl:param name="man.hyphenate">0</xsl:param>
<!--
Mainly for example blocks: indent the whole example after
the title, like this:
Example 1. Do something
Amet consectetur adipisicing minim sunt ad dolore culpa
enim labore incididunt cillum exercitation non non
deserunt veniam consectetur sint.
$ lttng something
Voluptate aliquip.
instead of:
Example 1. Do something
Amet consectetur adipisicing minim sunt ad dolore culpa
enim labore incididunt cillum exercitation non non
deserunt veniam consectetur sint.
$ lttng something
Voluptate aliquip.
-->
<xsl:template name="formal.object">
<xsl:param name="placement" select="'before'"/>
<xsl:param name="class" select="local-name(.)"/>
<xsl:choose>
<xsl:when test="$placement = 'before'">
<xsl:call-template name="formal.object.heading"/>
<xsl:text>.RS 4 </xsl:text>
<xsl:apply-templates/>
<xsl:text>.RE </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>.RS 4 </xsl:text>
<xsl:apply-templates/>
<xsl:text>.RE </xsl:text>
<xsl:call-template name="formal.object.heading"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
|