<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="head" mode="head.mode"> <xsl:variable name="nodes" select="*"/> <head> <meta name="generator" content="Website XSL Stylesheet V{$VERSION}"/> <xsl:if test="$html.stylesheet != ''"> <link rel="stylesheet" href="{$html.stylesheet}" type="text/css"> <xsl:if test="$html.stylesheet.type != ''"> <xsl:attribute name="type"> <xsl:value-of select="$html.stylesheet.type"/> </xsl:attribute> </xsl:if> </link> </xsl:if> <xsl:variable name="thisid" select="ancestor-or-self::webpage/@id"/> <xsl:variable name="thisrelpath"> <xsl:apply-templates select="$autolayout//*[@id=$thisid]" mode="toc-rel-path"/> </xsl:variable> <xsl:variable name="topid"> <xsl:call-template name="top.page"/> </xsl:variable> <xsl:if test="$topid != ''"> <link rel="home"> <xsl:attribute name="href"> <xsl:call-template name="page.uri"> <xsl:with-param name="page" select="$autolayout//*[@id=$topid]"/> <xsl:with-param name="relpath" select="$thisrelpath"/> </xsl:call-template> </xsl:attribute> <xsl:attribute name="title"> <xsl:value-of select="$autolayout//*[@id=$topid]/title"/> </xsl:attribute> </link> </xsl:if> <xsl:variable name="upid"> <xsl:call-template name="up.page"/> </xsl:variable> <xsl:if test="$upid != ''"> <link rel="up"> <xsl:attribute name="href"> <xsl:call-template name="page.uri"> <xsl:with-param name="page" select="$autolayout//*[@id=$upid]"/> <xsl:with-param name="relpath" select="$thisrelpath"/> </xsl:call-template> </xsl:attribute> <xsl:attribute name="title"> <xsl:value-of select="$autolayout//*[@id=$upid]/title"/> </xsl:attribute> </link> </xsl:if> <xsl:variable name="previd"> <xsl:call-template name="prev.page"/> </xsl:variable> <xsl:if test="$previd != ''"> <link rel="previous"> <xsl:attribute name="href"> <xsl:call-template name="page.uri"> <xsl:with-param name="page" select="$autolayout//*[@id=$previd]"/> <xsl:with-param name="relpath" select="$thisrelpath"/> </xsl:call-template> </xsl:attribute> <xsl:attribute name="title"> <xsl:value-of select="$autolayout//*[@id=$previd]/title"/> </xsl:attribute> </link> </xsl:if> <xsl:variable name="nextid"> <xsl:call-template name="next.page"/> </xsl:variable> <xsl:if test="$nextid != ''"> <link rel="next"> <xsl:attribute name="href"> <xsl:call-template name="page.uri"> <xsl:with-param name="page" select="$autolayout//*[@id=$nextid]"/> <xsl:with-param name="relpath" select="$thisrelpath"/> </xsl:call-template> </xsl:attribute> <xsl:attribute name="title"> <xsl:value-of select="$autolayout//*[@id=$nextid]/title"/> </xsl:attribute> </link> </xsl:if> <xsl:variable name="firstid"> <xsl:call-template name="first.page"/> </xsl:variable> <xsl:if test="$firstid != ''"> <link rel="first"> <xsl:attribute name="href"> <xsl:call-template name="page.uri"> <xsl:with-param name="page" select="$autolayout//*[@id=$firstid]"/> <xsl:with-param name="relpath" select="$thisrelpath"/> </xsl:call-template> </xsl:attribute> <xsl:attribute name="title"> <xsl:value-of select="$autolayout//*[@id=$firstid]/title"/> </xsl:attribute> </link> </xsl:if> <xsl:variable name="lastid"> <xsl:call-template name="last.page"/> </xsl:variable> <xsl:if test="$lastid != ''"> <link rel="last"> <xsl:attribute name="href"> <xsl:call-template name="page.uri"> <xsl:with-param name="page" select="$autolayout//*[@id=$lastid]"/> <xsl:with-param name="relpath" select="$thisrelpath"/> </xsl:call-template> </xsl:attribute> <xsl:attribute name="title"> <xsl:value-of select="$autolayout//*[@id=$lastid]/title"/> </xsl:attribute> </link> </xsl:if> <xsl:apply-templates select="$autolayout/autolayout/style |$autolayout/autolayout/script |$autolayout/autolayout/headlink" mode="head.mode"> <xsl:with-param name="webpage" select="ancestor::webpage"/> </xsl:apply-templates> <xsl:apply-templates mode="head.mode"/> <xsl:call-template name="user.head.content"> <xsl:with-param name="node" select="ancestor::webpage"/> </xsl:call-template> </head> </xsl:template> <xsl:template match="title" mode="head.mode"> <title><xsl:value-of select="."/></title> </xsl:template> <xsl:template match="titleabbrev" mode="head.mode"> <!--nop--> </xsl:template> <xsl:template match="subtitle" mode="head.mode"> <!--nop--> </xsl:template> <xsl:template match="summary" mode="head.mode"> <!--nop--> </xsl:template> <xsl:template match="base" mode="head.mode"> <base href="{@href}"> <xsl:if test="@target"> <xsl:attribute name="target"> <xsl:value-of select="@target"/> </xsl:attribute> </xsl:if> </base> </xsl:template> <xsl:template match="keywords" mode="head.mode"> <meta name="keyword" content="{.}"/> <meta name="keywords" content="{.}"/> </xsl:template> <xsl:template match="copyright" mode="head.mode"> <!--nop--> </xsl:template> <xsl:template match="author" mode="head.mode"> <!--nop--> </xsl:template> <xsl:template match="edition" mode="head.mode"> <!--nop--> </xsl:template> <xsl:template match="meta" mode="head.mode"> <xsl:choose> <xsl:when test="@http-equiv"> <meta http-equiv="{@http-equiv}" content="{@content}"/> </xsl:when> <xsl:otherwise> <meta name="{@name}" content="{@content}"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="script" mode="head.mode"> <script> <xsl:choose> <xsl:when test="@language"> <xsl:attribute name="language"> <xsl:value-of select="@language"/> </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="language">JavaScript</xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="@type"> <xsl:attribute name="type"> <xsl:value-of select="@type"/> </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="type">text/javascript</xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:apply-templates/> </script> </xsl:template> <xsl:template match="script[@src]" mode="head.mode" priority="2"> <xsl:param name="webpage" select="ancestor::webpage"/> <xsl:variable name="relpath"> <xsl:call-template name="root-rel-path"> <xsl:with-param name="webpage" select="$webpage"/> </xsl:call-template> </xsl:variable> <xsl:variable name="language"> <xsl:choose> <xsl:when test="@language"> <xsl:value-of select="@language"/> </xsl:when> <xsl:otherwise>JavaScript</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="type"> <xsl:choose> <xsl:when test="@type"> <xsl:value-of select="@type"/> </xsl:when> <xsl:otherwise>text/javascript</xsl:otherwise> </xsl:choose> </xsl:variable> <script src="{$relpath}{@src}" language="{$language}" type="{$type}"/> </xsl:template> <xsl:template match="style" mode="head.mode"> <style> <xsl:if test="@type"> <xsl:attribute name="type"> <xsl:value-of select="@type"/> </xsl:attribute> </xsl:if> <xsl:apply-templates/> </style> </xsl:template> <xsl:template match="style[@src]" mode="head.mode" priority="2"> <xsl:param name="webpage" select="ancestor::webpage"/> <xsl:variable name="relpath"> <xsl:call-template name="root-rel-path"> <xsl:with-param name="webpage" select="$webpage"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="starts-with(@src, '/')"> <link rel="stylesheet" href="{@src}"> <xsl:if test="@type"> <xsl:attribute name="type"> <xsl:value-of select="@type"/> </xsl:attribute> </xsl:if> </link> </xsl:when> <xsl:otherwise> <link rel="stylesheet" href="{$relpath}{@src}"> <xsl:if test="@type"> <xsl:attribute name="type"> <xsl:value-of select="@type"/> </xsl:attribute> </xsl:if> </link> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="headlink" mode="head.mode"> <link> <xsl:copy-of select="@*"/> </link> </xsl:template> <xsl:template match="abstract" mode="head.mode"> <!--nop--> </xsl:template> <xsl:template match="revhistory" mode="head.mode"> <!--nop--> </xsl:template> <xsl:template match="rddl:*" mode="head.mode" xmlns:rddl='http://www.rddl.org/'> <!--nop--> </xsl:template> </xsl:stylesheet>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 26953 | Paul Allen | Move //guest/perforce_software/p4convert to //guest/perforce_software/p4convert/main | ||
//guest/perforce_software/p4convert/docs/docbook-xsl-ns-1.78.1/website/head.xsl | |||||
#2 | 14806 | Paul Allen | Update docs and add +w. | ||
#1 | 13920 | Paul Allen | copy part 2 (no errors) | ||
//guest/paul_allen/p4convert-maven/docs/docbook-xsl-ns-1.78.1/website/head.xsl | |||||
#1 | 13895 | Paul Allen | Copying using p4convert-docbook | ||
//guest/perforce_software/doc_build/main/docbook-xsl-ns-1.78.1/website/head.xsl | |||||
#1 | 12728 | eedwards |
Upgrade ANT doc build infrastructure to assemble PDFs: - remove non-namespaced DocBook source and add namespaced DocBook source. - add Apache FOP 1.1 - copy fonts, images, XSL into _build, establishing new asset structure. The original structure remains until all guides using it can be upgraded, and several other issues can be resolved. - updated build.xml to allow for per-target build properties. - upgraded the P4SAG to use the new infrastructure. - tweaked admonition presentation in PDFs to remove admonition graphics, and resemble closely the presentation used in the new HTML layout, including the same colors. With these changes, building PDFs involves using a shell, navigating into the guide's directory (just P4SAG for now), and executing "ant pdf". Issues still to be resolved: - PDF generation encounters several warnings about missing fonts (bold versions of Symbol and ZapfDingbats), and a couple of locations where the page content exceeds the defined content area. - Due to issues within Apache FOP, PDF generation emits a substantial amount of output that is not easily suppressed without losing important warning information. - Apache FOP's interface to ANT does not expose a way to set the font base directory. The current configuration does work under Mac OSX, but further testing on Windows will need to be done to determine if the relative paths defined continue to work. The workaround is for Windows users to customize the fop-config.xml to provide absolute system paths to the required fonts. - HTML generation needs further browser testing, and exhibits broken navigation on iOS browsers within the TOC sidebar. - A number of PDF and HTML presentation tweaks still need to be made, for example: sidebars, gui* DocBook tags, whitespace, section separation, etc. |