diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2015-06-12 14:51:00 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2015-06-16 18:28:40 +0100 |
commit | 646745cbf32a341c34d7992ae30e7ad45c172881 (patch) | |
tree | bc3aa4dd7bc553cefc46bfa062a59976dd1abb2d /winsup/doc/fo.xsl | |
parent | 07605dccd2281e2daac08785a829553c60c0e1a8 (diff) | |
download | cygnal-646745cbf32a341c34d7992ae30e7ad45c172881.tar.gz cygnal-646745cbf32a341c34d7992ae30e7ad45c172881.tar.bz2 cygnal-646745cbf32a341c34d7992ae30e7ad45c172881.zip |
winsup/doc: Convert utils.xml to using refentry elements
Convert utils.xml from using a sect2 element to using a refentry element for
each utility program. This makes it possible to generate manpage-style output
for those elements.
Note that the chunked html now generates a page for each utility, rather than
one containing all utilities.
A small customization to TOC generation for HTML and PDF is needed to ensure
that it appears as before, containing an entry for each utility command.
Future work: synopsis and options sections could use more detailed markup than
just wrapping the whole thing in <screen>
2015-06-12 Jon Turney <jon.turney@dronecode.org.uk>
* utils.xml : Convert from using a sect2 element to using a
refentry element for each utility program.
* cygwin.xsl: Customize autotoc to include refentries.
* fo.xsl: Ditto.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Diffstat (limited to 'winsup/doc/fo.xsl')
-rw-r--r-- | winsup/doc/fo.xsl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/winsup/doc/fo.xsl b/winsup/doc/fo.xsl index 4bc255ce8..ba8e19138 100644 --- a/winsup/doc/fo.xsl +++ b/winsup/doc/fo.xsl @@ -29,4 +29,40 @@ <!-- Inform the DocBook stylesheets that it's safe to use FOP specific extensions. --> <xsl:param name="fop1.extensions" select="1"/> + + <!-- autotoc.xsl customization to make refentry in sect1 appear in toc --> +<xsl:template match="sect1" mode="toc"> + <xsl:param name="toc-context" select="."/> + + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <xsl:variable name="cid"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$toc-context"/> + </xsl:call-template> + </xsl:variable> + + <xsl:call-template name="toc.line"> + <xsl:with-param name="toc-context" select="$toc-context"/> + </xsl:call-template> + + <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/> + + <xsl:if test="$toc.section.depth > 1 + and $toc.max.depth > $depth.from.context"> + <fo:block id="toc.{$cid}.{$id}"> + <xsl:attribute name="margin-{$direction.align.start}"> + <xsl:call-template name="set.toc.indent"/> + </xsl:attribute> + + <xsl:apply-templates select="refentry|sect2|qandaset[$qanda.in.toc != 0]" + mode="toc"> + <xsl:with-param name="toc-context" select="$toc-context"/> + </xsl:apply-templates> + </fo:block> + </xsl:if> +</xsl:template> + </xsl:stylesheet> |