doc/man/manpage.xsl: indent the body of formal (example) blocks
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 6 May 2021 19:09:58 +0000 (15:09 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 10 May 2021 19:08:23 +0000 (15:08 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I184b1bc54728cf0d770bc44f9f0923b9f8724396

doc/man/manpage.xsl

index 5f6a39642e02618fea645b3b115313106bd8d9f9..b8f7268486a53fa340c4c3810918e92e75484338 100644 (file)
 
     <!-- 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&#10;</xsl:text>
+                <xsl:apply-templates/>
+                <xsl:text>.RE&#10;</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:text>.RS 4&#10;</xsl:text>
+                <xsl:apply-templates/>
+                <xsl:text>.RE&#10;</xsl:text>
+                <xsl:call-template name="formal.object.heading"/>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
 </xsl:stylesheet>
This page took 0.025213 seconds and 4 git commands to generate.