Changeset fc82888


Ignore:
Timestamp:
01/14/2023 04:02:44 PM (15 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
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
Message:

Add comments to pythonhosted.xsl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stylesheets/pythonhosted.xsl

    rda7d9ae rfc82888  
    66  <xsl:output method="text"/>
    77
     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.-->
    812  <xsl:include href="pyhosted-inc.xsl"/>
     13  <!-- list of python modules whose dependencies should be listed -->
    914  <xsl:param name="packages">requests sphinx_rtd_theme pytest</xsl:param>
     15  <!-- Name of the .xml where to find all python dependencies -->
    1016  <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.-->
    1120  <xsl:variable name="raw-dep-list">
    1221    <xsl:call-template name="gen-deps">
     
    1423    </xsl:call-template>
    1524  </xsl:variable>
     25  <!-- This variable is a copy of raw-dep-list, but with duplicates removed -->
    1626  <xsl:variable name="dep-list">
    1727    <xsl:call-template name="make-unique">
     
    2131  </xsl:variable>
    2232
     33  <!-- scan the list of modules and generates dependencies for each -->
    2334  <xsl:template name="gen-deps">
    2435    <xsl:param name="list" select="$packages"/>
     
    4051  </xsl:template>
    4152
     53  <!-- This template is applied recursively for each dependency. -->
    4254  <xsl:template match="*" mode="gen-dep">
    43     <!--
     55    <!-- for debugging
    4456    <xsl:message>
    4557      <xsl:text>generating deps for </xsl:text>
     
    5567  </xsl:template>
    5668
     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 -->
    5772  <xsl:template match="para" mode="dep-list">
    5873    <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.-->
    5977      <xsl:choose>
    6078        <xsl:when test="//*[@id=current()/@linkend]">
     
    7290  </xsl:template>
    7391
     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 -->
    7495  <xsl:template name="make-unique">
    7596    <xsl:param name="list" select="$raw-dep-list"/>
     
    80101        <xsl:variable name="temp1">
    81102          <xsl:choose>
     103       <!-- the concat is needed to prevent problems with a package
     104            containing the name of another package -->
    82105            <xsl:when test="contains($temp,concat(' ',$package,' '))">
    83106              <xsl:copy-of select="$temp"/>
     
    110133  </xsl:template>
    111134
     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 -->
    112138  <xsl:template match="/">
    113     <!--
     139    <!-- debug
    114140    <xsl:message>
    115141      <xsl:text>Generating new pythonhosted.xml with list:
     
    141167      </xsl:when>
    142168      <xsl:otherwise>
     169       <!-- first try to find the dependency in python-modules. If so, precede
     170            it with a `#' -->
    143171        <xsl:apply-templates
    144172          select="id($list)"
     
    146174          <xsl:with-param name="first-char" select="'#'"/>
    147175        </xsl:apply-templates>
     176        <!-- then try in python-dependencies -->
    148177        <xsl:apply-templates
    149178          select="document($python-deps,/)//sect2[@id=$list]"
     
    155184  <xsl:template match="sect2" mode="md5-line">
    156185    <xsl:param name="first-char" select="''"/>
    157     <!--
     186    <!-- debug
    158187    <xsl:message>
    159188      <xsl:text>Generating md5 for </xsl:text>
Note: See TracChangeset for help on using the changeset viewer.