From 0ccfcd0361cd630b9daaf0f19062fe546ce9ddad Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Tue, 2 Jun 2020 12:24:45 +0200 Subject: [PATCH] news: Output reStructuredText for the ASCII version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ASCII output our scripts produce is already very close to reStructuredText, and with just a few extra tweaks we can get almost all of the way there. Signed-off-by: Andrea Bolognani Reviewed-by: Ján Tomko --- docs/news-ascii.xsl | 40 +++++++++++++++++++++++++++++++++------- scripts/reformat-news.py | 20 ++++++++++---------- 2 files changed, 43 insertions(+), 17 deletions(-) diff --git a/docs/news-ascii.xsl b/docs/news-ascii.xsl index 8dacae934c..9f6c61a3c6 100644 --- a/docs/news-ascii.xsl +++ b/docs/news-ascii.xsl @@ -8,36 +8,48 @@ - libvirt releases + ================ +libvirt releases ================ + +This is the list of official releases for libvirt, along with an overview of +the changes introduced by each of them. + +For a more fine-grained view, use the `git log`_. -============================================================================== + Older libvirt releases didn't have proper release notes: if you are interested -in changes between them, you should check out docs/news-*.html or the full git +in changes between them, you should check out docs/news-\*.html or the full git log (see instructions in ChangeLog). + + +.. _git log: https://gitlab.com/libvirt/libvirt/-/commits/master -# + + ( ) +=================== + -* +* ** - + ** @@ -60,10 +72,24 @@ log (see instructions in ChangeLog). + + | - + + + + + + + + + `` + + `` + + diff --git a/scripts/reformat-news.py b/scripts/reformat-news.py index 7bc752d821..d1c3906bd8 100755 --- a/scripts/reformat-news.py +++ b/scripts/reformat-news.py @@ -61,22 +61,22 @@ def reformat(line): # on the first character marker = line[0] - # Release - if marker == '#': + # Section + if marker == '*': initial_indent = 0 indent = 2 - # Section - elif marker == '*': - initial_indent = 2 - indent = 4 # Change summary elif marker == '-': - initial_indent = 4 - indent = 6 + initial_indent = 2 + indent = 4 + # We use different markers to be able to tell apart the various + # possible indentation levels, but we want to always output the + # same marker in the generated file + line = '*' + line[1:] # Change description elif marker == '|': - initial_indent = 8 - indent = 8 + initial_indent = 4 + indent = 4 # In this one case, the marker should not ultimately show # up in the output file, so we strip it before moving on line = line[1:] -- GitLab