diff options
author | Andrea Bolognani <abologna@redhat.com> | 2017-01-03 12:22:54 +0100 |
---|---|---|
committer | Andrea Bolognani <abologna@redhat.com> | 2017-01-10 19:37:53 +0100 |
commit | be36ea4b52c33c7472638b577fcdedf5183f4893 (patch) | |
tree | 164185e7c279f0cc40082fd47d00d591548d3f2e /docs/news-ascii.xsl | |
parent | 3027bacf959fe355f7a36ed255f1865be33ca64b (diff) | |
download | libvirt-be36ea4b52c33c7472638b577fcdedf5183f4893.tar.gz |
NEWS: Improve building pipeline
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.
Diffstat (limited to 'docs/news-ascii.xsl')
-rw-r--r-- | docs/news-ascii.xsl | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/docs/news-ascii.xsl b/docs/news-ascii.xsl new file mode 100644 index 0000000000..637c432d67 --- /dev/null +++ b/docs/news-ascii.xsl @@ -0,0 +1,68 @@ +<?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> |