summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndrea Bolognani <abologna@redhat.com>2020-06-02 12:24:45 +0200
committerAndrea Bolognani <abologna@redhat.com>2020-06-05 16:27:33 +0200
commit0ccfcd0361cd630b9daaf0f19062fe546ce9ddad (patch)
treefbd9777668926bcc9fe52601a9326bc17e52a622 /scripts
parent1482f2148c61ab86db4c9a360322726947d3ec3e (diff)
downloadlibvirt-0ccfcd0361cd630b9daaf0f19062fe546ce9ddad.tar.gz
news: Output reStructuredText for the ASCII version
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 <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/reformat-news.py20
1 files changed, 10 insertions, 10 deletions
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:]