Changeset fc82888
- Timestamp:
- 01/14/2023 04:02:44 PM (15 months ago)
- Branches:
- 11.3, 12.0, 12.1, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, xry111/llvm18, xry111/xf86-video-removal
- Children:
- e0fff61
- Parents:
- da7d9ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/pythonhosted.xsl
rda7d9ae rfc82888 6 6 <xsl:output method="text"/> 7 7 8 <!-- The pyhosted-inc.xsl file contains two variables, one containing 9 the text of 10 pythonhosted.xml before the creation of pythonhosted-files.md5, 11 the other containing the text after that.--> 8 12 <xsl:include href="pyhosted-inc.xsl"/> 13 <!-- list of python modules whose dependencies should be listed --> 9 14 <xsl:param name="packages">requests sphinx_rtd_theme pytest</xsl:param> 15 <!-- Name of the .xml where to find all python dependencies --> 10 16 <xsl:variable name="python-deps">python-dependencies.xml</xsl:variable> 17 <!-- This variable is a scan of the dependency graph in depth first order. 18 it is a suitable order for building, except it contains many 19 duplicates.--> 11 20 <xsl:variable name="raw-dep-list"> 12 21 <xsl:call-template name="gen-deps"> … … 14 23 </xsl:call-template> 15 24 </xsl:variable> 25 <!-- This variable is a copy of raw-dep-list, but with duplicates removed --> 16 26 <xsl:variable name="dep-list"> 17 27 <xsl:call-template name="make-unique"> … … 21 31 </xsl:variable> 22 32 33 <!-- scan the list of modules and generates dependencies for each --> 23 34 <xsl:template name="gen-deps"> 24 35 <xsl:param name="list" select="$packages"/> … … 40 51 </xsl:template> 41 52 53 <!-- This template is applied recursively for each dependency. --> 42 54 <xsl:template match="*" mode="gen-dep"> 43 <!-- 55 <!-- for debugging 44 56 <xsl:message> 45 57 <xsl:text>generating deps for </xsl:text> … … 55 67 </xsl:template> 56 68 69 <!-- this template calls the preceding one for each dependency found, 70 printing the name of the dependency afterwards. This generates the 71 depth-first order --> 57 72 <xsl:template match="para" mode="dep-list"> 58 73 <xsl:for-each select="xref"> 74 <!-- The linkend may point either to the current document, or 75 if not found to the python-dependencies.xml document. Note 76 that the current document may be already python-dependencies.xml.--> 59 77 <xsl:choose> 60 78 <xsl:when test="//*[@id=current()/@linkend]"> … … 72 90 </xsl:template> 73 91 92 <!-- Template to remove duplicates. Each time it is called, the param 93 "list" contains the list remaining to be processed, and the 94 param "temp" contains the already processed list with no duplicates --> 74 95 <xsl:template name="make-unique"> 75 96 <xsl:param name="list" select="$raw-dep-list"/> … … 80 101 <xsl:variable name="temp1"> 81 102 <xsl:choose> 103 <!-- the concat is needed to prevent problems with a package 104 containing the name of another package --> 82 105 <xsl:when test="contains($temp,concat(' ',$package,' '))"> 83 106 <xsl:copy-of select="$temp"/> … … 110 133 </xsl:template> 111 134 135 <!-- with the variable dep-list, we can apply templates for generating 136 the content of the .md5 file. We just have to copy the variables set 137 in pyhosted-inc before and after that file --> 112 138 <xsl:template match="/"> 113 <!-- 139 <!-- debug 114 140 <xsl:message> 115 141 <xsl:text>Generating new pythonhosted.xml with list: … … 141 167 </xsl:when> 142 168 <xsl:otherwise> 169 <!-- first try to find the dependency in python-modules. If so, precede 170 it with a `#' --> 143 171 <xsl:apply-templates 144 172 select="id($list)" … … 146 174 <xsl:with-param name="first-char" select="'#'"/> 147 175 </xsl:apply-templates> 176 <!-- then try in python-dependencies --> 148 177 <xsl:apply-templates 149 178 select="document($python-deps,/)//sect2[@id=$list]" … … 155 184 <xsl:template match="sect2" mode="md5-line"> 156 185 <xsl:param name="first-char" select="''"/> 157 <!-- 186 <!-- debug 158 187 <xsl:message> 159 188 <xsl:text>Generating md5 for </xsl:text>
Note:
See TracChangeset
for help on using the changeset viewer.