diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-06-02 05:28:06 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-06-02 05:28:06 +0000 |
commit | 21d19e4dbe9a3a1f724a1963d13af21004a06e55 (patch) | |
tree | 8333b427632f129e005ca6f7d4796c18ffddccb6 /documentation/xsl | |
parent | 491dc3d0e3ff77223118aac4712bf9ed2dac63a8 (diff) | |
download | lcd4linux-21d19e4dbe9a3a1f724a1963d13af21004a06e55.tar.gz |
[lcd4linux @ 2004-06-02 05:27:59 by reinelt]
added documentation tree
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@458 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r-- | documentation/xsl/body.xsl | 20 | ||||
-rw-r--r-- | documentation/xsl/doc.xsl | 29 | ||||
-rw-r--r-- | documentation/xsl/head.xsl | 68 | ||||
-rw-r--r-- | documentation/xsl/helpers.xsl | 141 | ||||
-rw-r--r-- | documentation/xsl/references.xsl | 47 | ||||
-rw-r--r-- | documentation/xsl/xhtml.xsl | 16 |
6 files changed, 321 insertions, 0 deletions
diff --git a/documentation/xsl/body.xsl b/documentation/xsl/body.xsl new file mode 100644 index 0000000..8b13ebd --- /dev/null +++ b/documentation/xsl/body.xsl @@ -0,0 +1,20 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<!-- + XSL stylesheet for processing documentation for the lcd4linux project + Copyright 2004 Xavier Vello <xavier66@free.fr> + Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> +--> + +<!--The content of the page--> + +<xsl:template match="body" node="doc"> + <xsl:element name="body"> + <!--Here will be added html code for the layout--> + <xsl:apply-templates select="/doc/head/links"/> + <xsl:element name="h1"> + <xsl:value-of select="/doc/head/title"/> + </xsl:element> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> +</xsl:stylesheet> diff --git a/documentation/xsl/doc.xsl b/documentation/xsl/doc.xsl new file mode 100644 index 0000000..1a2045f --- /dev/null +++ b/documentation/xsl/doc.xsl @@ -0,0 +1,29 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<!-- + XSL stylesheet for processing documentation for the lcd4linux project + Copyright 2004 Xavier Vello <xavier66@free.fr> + Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> +--> + +<xsl:output omit-xml-declaration="yes" method="xml" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/> + +<xsl:variable name="references" select="document('../data/references.xml')/references"/> +<xsl:param name="class" select="''"/> +<xsl:param name="root" select="''"/> + +<!--Includes--> +<xsl:include href="head.xsl"/> +<xsl:include href="body.xsl"/> +<xsl:include href="helpers.xsl"/> +<xsl:include href="xhtml.xsl"/> +<xsl:include href="references.xsl"/> + +<!--The start point--> +<xsl:template match="doc"> + <xsl:element name="html"> + <xsl:apply-templates select="head"/> + <xsl:apply-templates select="body"/> + </xsl:element> +</xsl:template> + +</xsl:stylesheet> diff --git a/documentation/xsl/head.xsl b/documentation/xsl/head.xsl new file mode 100644 index 0000000..7d975dd --- /dev/null +++ b/documentation/xsl/head.xsl @@ -0,0 +1,68 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<!-- + XSL stylesheet for processing documentation for the lcd4linux project + Copyright 2004 Xavier Vello <xavier66@free.fr> + Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> +--> + +<!--The info node, to generate headers--> + +<xsl:template match="head" node="doc"> + <xsl:element name="head"> + <xsl:apply-templates select="title"/> + <xsl:apply-templates select="ref"/> + <xsl:element name="link"> + <xsl:attribute name="rel">stylesheet</xsl:attribute> + <xsl:attribute name="href"> + <xsl:copy-of select="$root"/> + <xsl:text>doc.css</xsl:text> + </xsl:attribute> + <xsl:attribute name="type">text/css</xsl:attribute> + </xsl:element> + </xsl:element> +</xsl:template> + +<xsl:template match="title" node="head"> + <xsl:element name="title"> + <xsl:value-of select="."/> + </xsl:element> +</xsl:template> + +<xsl:template match="ref" node="head"> +</xsl:template> + +<xsl:template match="history" node="head"> + <table border="1"> + <xsl:for-each select="revision"> + <tr> + <td><xsl:value-of select="@version"/></td> + <td><xsl:value-of select="."/></td> + </tr> + </xsl:for-each> + </table> +</xsl:template> + +<xsl:template match="links" node="head"> + <xsl:element name="div"> + <xsl:attribute name="class">links</xsl:attribute> + <xsl:element name="div"> + <xsl:attribute name="class">title</xsl:attribute> + See Also + </xsl:element> + + <xsl:apply-templates select="link" mode="head"/> + + <xsl:element name="div"> + <xsl:attribute name="class">index</xsl:attribute> + <xsl:element name="a"> + <xsl:attribute name="href"> + <xsl:copy-of select="$root"/> + <xsl:text>index.html</xsl:text> + </xsl:attribute> + <xsl:text>< Index</xsl:text> + </xsl:element> + </xsl:element> + </xsl:element> +</xsl:template> + +</xsl:stylesheet> diff --git a/documentation/xsl/helpers.xsl b/documentation/xsl/helpers.xsl new file mode 100644 index 0000000..df91a4a --- /dev/null +++ b/documentation/xsl/helpers.xsl @@ -0,0 +1,141 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<!-- + XSL stylesheet for processing documentation for the lcd4linux project + Copyright 2004 Xavier Vello <xavier66@free.fr> + Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> +--> + +<!--The special helpers--> + +<xsl:template match="cmd"> + <xsl:element name="div"> + <xsl:attribute name="class">cmd</xsl:attribute> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="conf"> + <xsl:element name="div"> + <xsl:attribute name="class">conf</xsl:attribute> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="note"> + <xsl:element name="div"> + <xsl:attribute name="class">note</xsl:attribute> + <xsl:element name="img"> + <xsl:attribute name="src"> + <xsl:copy-of select="$root"/> + <xsl:text>images/note-icon.png</xsl:text> + </xsl:attribute> + <xsl:attribute name="alt"> + <xsl:text>Note : </xsl:text> + </xsl:attribute> + <xsl:attribute name="class">icon</xsl:attribute> + </xsl:element> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="warn"> + <xsl:element name="div"> + <xsl:attribute name="class">warn</xsl:attribute> + <xsl:element name="img"> + <xsl:attribute name="src"> + <xsl:copy-of select="$root"/> + <xsl:text>images/warn-icon.png</xsl:text> + </xsl:attribute> + <xsl:attribute name="alt"> + <xsl:text>Warning : </xsl:text> + </xsl:attribute> + <xsl:attribute name="class">icon</xsl:attribute> + </xsl:element> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="new"> <!--This last will be more complicated--> + <xsl:element name="div"> + <xsl:attribute name="class">new</xsl:attribute> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="link" mode="head"> + <xsl:apply-templates select="."/> + <xsl:element name="br"/> +</xsl:template> + +<xsl:template match="link"> + <xsl:choose> + <xsl:when test="@ref"> + <xsl:variable name="refid" select="@ref"/> + <xsl:choose> + <xsl:when test="$references/ref[@id=$refid]"> + <xsl:element name="a"> + <xsl:attribute name="href"> + <xsl:choose> + <xsl:when test="$references/ref[@id=$refid]/class = $class"> + <xsl:value-of select="concat($references/ref[@id=$refid]/file, '.html', $references/ref[@id=$refid]/anchor)"/> + </xsl:when> + <xsl:when test="not(string-length($references/ref[@id=$refid]/class))"> + <xsl:copy-of select="$root"/> + <xsl:value-of select="concat($references/ref[@id=$refid]/file, '.html', $references/ref[@id=$refid]/anchor)"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$root"/> + <xsl:value-of select="concat($references/ref[@id=$refid]/class, '/', $references/ref[@id=$refid]/file, '.html', $references/ref[@id=$refid]/anchor)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:choose> + <xsl:when test="string-length(.)"> + <xsl:value-of select="."/> + </xsl:when> + <xsl:when test="$references/ref[@id=$refid]/label"> + <xsl:value-of select="$references/ref[@id=$refid]/label"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>NO LABEL</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:element> + </xsl:when> + </xsl:choose> + </xsl:when> + <xsl:when test="@url"> + <xsl:element name="a"> + <xsl:attribute name="href"> + <xsl:value-of select="@url"/> + </xsl:attribute> + <xsl:choose> + <xsl:when test="string-length(.)"> + <xsl:value-of select="."/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@url"/> + </xsl:otherwise> + </xsl:choose> + </xsl:element> + </xsl:when> + <xsl:otherwise> + <xsl:message><xsl:value-of select="current()"/> : invalid link !</xsl:message> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="index"> + <xsl:choose> + <xsl:when test="@class"> + <xsl:apply-templates select="$references/ref"> + <xsl:with-param name="class"><xsl:value-of select="@class"/></xsl:with-param> + </xsl:apply-templates> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$references/ref"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/documentation/xsl/references.xsl b/documentation/xsl/references.xsl new file mode 100644 index 0000000..4dc47f6 --- /dev/null +++ b/documentation/xsl/references.xsl @@ -0,0 +1,47 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<!-- + XSL stylesheet for processing documentation for the lcd4linux project + Copyright 2004 Xavier Vello <xavier66@free.fr> + Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> +--> + +<xsl:template match="ref" node="references"> + <xsl:param name="class" select="''"/> + <xsl:choose> + <xsl:when test="class=$class"> + <xsl:apply-templates select="." mode="link"/> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="ref" node="references" mode="link"> + <xsl:choose> + <xsl:when test="not(hiden)"> + <xsl:element name="a"> + <xsl:attribute name="href"> + <xsl:choose> + <xsl:when test="not(string-length(class))"> + <xsl:copy-of select="$root"/> + <xsl:value-of select="concat(file, '.html')"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$root"/> + <xsl:value-of select="concat(class, '/', file, '.html', anchor)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:choose> + <xsl:when test="label"> + <xsl:value-of select="label"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="file"/> + </xsl:otherwise> + </xsl:choose> + </xsl:element> + <xsl:element name="br"/> + </xsl:when> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/documentation/xsl/xhtml.xsl b/documentation/xsl/xhtml.xsl new file mode 100644 index 0000000..1f5cb98 --- /dev/null +++ b/documentation/xsl/xhtml.xsl @@ -0,0 +1,16 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<!-- + XSL stylesheet for processing documentation for the lcd4linux project + Copyright 2004 Xavier Vello <xavier66@free.fr> + Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> +--> + +<!--Standard html tags, just a wraper--> + +<xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> +</xsl:template> + +</xsl:stylesheet> |