mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
be36ea4b52
Currently, building the NEWS file involves using a XSLT stylesheet to extract information from the same HTML file that's used on the libvirt website. The process works, but it's quite fiddly in that it requires the source HTML to be formatted in a very precise way, and a single missing newline can mess up the resulting plain text considerably. Moreover, the XSLT stylesheet itself encodes a lot of the details of converting to plain text in a way that's not necessarily easy to understand, tweak or fix. To improve the process, move all existing entries to a new XML file that contains exactly the information we care about in a simple structured format, and start generating both the HTML and plain text versions of the release notes using XSLT stylesheets that can now afford to be almost trivial.
69 lines
1.9 KiB
XML
69 lines
1.9 KiB
XML
<?xml version="1.0"?>
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
<xsl:output method="text" encoding="UTF-8"/>
|
|
|
|
<!-- This XSLT stylesheet can be applied to the XML version of the release
|
|
notes to produce a plain text document. The output document is not
|
|
formatted properly and needs to be processed further -->
|
|
|
|
<!-- Document -->
|
|
<xsl:template match="/libvirt">
|
|
<xsl:text>libvirt releases
|
|
================
|
|
</xsl:text>
|
|
<xsl:apply-templates select="release"/>
|
|
<xsl:text>
|
|
==============================================================================
|
|
Older libvirt releases didn't have proper release notes: if you are interested
|
|
in changes between them, you should check out ChangeLog* and docs/news-*.html.
|
|
</xsl:text>
|
|
</xsl:template>
|
|
|
|
<!-- Release -->
|
|
<xsl:template match="release">
|
|
<xsl:text>
|
|
# </xsl:text>
|
|
<xsl:value-of select="@version"/>
|
|
<xsl:text> (</xsl:text>
|
|
<xsl:value-of select="@date"/>
|
|
<xsl:text>)
|
|
</xsl:text>
|
|
<xsl:apply-templates select="section"/>
|
|
</xsl:template>
|
|
|
|
<!-- Section -->
|
|
<xsl:template match="section">
|
|
<xsl:text>
|
|
* </xsl:text>
|
|
<xsl:value-of select="@title"/>
|
|
<xsl:text>
|
|
</xsl:text>
|
|
<xsl:apply-templates select="change"/>
|
|
</xsl:template>
|
|
|
|
<!-- Change -->
|
|
<xsl:template match="change">
|
|
<xsl:text>
|
|
</xsl:text>
|
|
<xsl:apply-templates select="summary"/>
|
|
<xsl:apply-templates select="description"/>
|
|
</xsl:template>
|
|
|
|
<!-- Change summary -->
|
|
<xsl:template match="summary">
|
|
<xsl:text>- </xsl:text>
|
|
<xsl:value-of select="normalize-space()"/>
|
|
<xsl:text>
|
|
</xsl:text>
|
|
</xsl:template>
|
|
|
|
<!-- Change description -->
|
|
<xsl:template match="description">
|
|
<xsl:text>|</xsl:text> <!-- This will be removed when reformatting -->
|
|
<xsl:value-of select="normalize-space()"/>
|
|
<xsl:text>
|
|
</xsl:text>
|
|
</xsl:template>
|
|
|
|
</xsl:stylesheet>
|