]> git.gir.st - tmk_keyboard.git/blob - protocol/lufa/LUFA-git/LUFA/StudioIntegration/XDK/lufa_module_transform.xslt
Squashed 'tmk_core/' changes from caca2c0..dc0e46e
[tmk_keyboard.git] / protocol / lufa / LUFA-git / LUFA / StudioIntegration / XDK / lufa_module_transform.xslt
1 <!--
2 LUFA Library
3 Copyright (C) Dean Camera, 2013.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 -->
8
9 <!-- Atmel Studio framework Module XML transform file -->
10
11 <!-- Creates an asf.xml module document from a given manifest list of XML files,
12 and adds appropriate documentation links by cross-referencing the Doxygen
13 tag output file to map Doxygen group names to generated filenames. -->
14 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
15 <xsl:output method="xml" omit-xml-declaration="yes"/>
16
17 <!-- Store the LUFA Doxygen tag filename mentioned in the root node for later use -->
18 <xsl:param name="lufa-doxygen-tagfile" select="lufa-manifest/@tagfile"/>
19
20 <!-- Store the LUFA Doxygen documentation filename mentioned in the root node for later use -->
21 <xsl:param name="lufa-doxygen-docfile" select="lufa-manifest/@docfile"/>
22
23 <!-- Read manifest list, add a comment to indicate the source filename
24 and then copy/process all ASF nodes in the referenced document -->
25 <xsl:template match="lufa-manifest">
26 <xsl:comment>This file has been automatically generated from the LUFA Atmel Studio integration XML files.</xsl:comment>
27
28 <asf xmlversion="1.0">
29 <xsl:for-each select="xml-source">
30 <xsl:comment>Sourced from <xsl:value-of select="@filename"/></xsl:comment>
31 <xsl:apply-templates select="document(@filename)/lufa/asf/*"/>
32 </xsl:for-each>
33 </asf>
34 </xsl:template>
35
36 <!-- Recursively match and copy/process all nodes/attributes -->
37 <xsl:template match="@*|node()">
38 <xsl:copy>
39 <xsl:apply-templates select="@*|node()"/>
40 </xsl:copy>
41 </xsl:template>
42
43 <!-- For Doxygen entry point nodes we need to convert them into help link
44 nodes instead and add descriptions, so that they show up as links in
45 Studio correctly -->
46 <xsl:template match="build[@type='doxygen-entry-point']">
47 <!-- select-by-config entries should not have a help link -->
48 <xsl:if test="not(parent::select-by-config)">
49 <build type="online-help" subtype="module-help-page-append">
50 <xsl:attribute name="value">
51 <!-- Extract filename of the HTML file that contains the documentation for this module from the Doxgen tag file -->
52 <xsl:value-of select="document($lufa-doxygen-tagfile)/tagfile/compound[name=current()/@value]/filename"/>
53 </xsl:attribute>
54 </build>
55 </xsl:if>
56
57 <!-- Modules inside a select-by-config entries should not have a help link -->
58 <xsl:if test="not(parent::module and ../parent::select-by-config)">
59 <info type="description" value="summary">
60 <!-- Extract brief description of the module from the Doxygen combined XML documentation file -->
61 <xsl:value-of select="document($lufa-doxygen-docfile)/doxygen/compounddef[compoundname=current()/@value]/briefdescription/para"/>
62 </info>
63 </xsl:if>
64 </xsl:template>
65
66 </xsl:stylesheet>
Imprint / Impressum