From 7b864ba52c68f633bbb7654c038dae7fa3269ca7 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 3 Jan 2018 15:47:04 +0100 Subject: Allow informative suffixes in QUIP file names This makes it easier to find the right txt/html file over time. Change-Id: Ic89b1d2434b594560b17711873dd5f78c914913a Reviewed-by: Edward Welbourne Reviewed-by: Lars Knoll --- quip-0001.rst | 11 +++++++++-- scripts/gen-quip-0000.py | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/quip-0001.rst b/quip-0001.rst index f201641..23f3e3b 100644 --- a/quip-0001.rst +++ b/quip-0001.rst @@ -133,13 +133,20 @@ rendered obsolete by one or several later QUIPs. The newer QUIPs must have a Replaces header containing the QUIPs that they render obsolete. +File Naming +=========== + +QUIPs must be named ``quip-XXXX[-shortname].rst`` where the -shortname is optional +to help identifying the right file. shortname must not be a number since that would +conflict with auxiliary files (see below). + Auxiliary Files =============== QUIPs may include auxiliary files such as diagrams. Such files must be -named ``quip-XXXX-Y.ext``, where "XXXX" is the QUIP number, "Y" is a +named ``quip-XXXX-Y[-shortname].ext``, where "XXXX" is the QUIP number, "Y" is a serial number (starting at 1), and "ext" is replaced by the actual -file extension (e.g. "png"). +file extension (e.g. "png"). The descriptive shortname is optional. References and Footnotes diff --git a/scripts/gen-quip-0000.py b/scripts/gen-quip-0000.py index 0f2ded9..afc6bc2 100755 --- a/scripts/gen-quip-0000.py +++ b/scripts/gen-quip-0000.py @@ -28,11 +28,12 @@ class RootQuip (dict): del last_name def quip_entries(self): - fmt = ' %4s%04d%s%s' + fmt = ' %4s%04d%s%s' for filename in sorted(self): q = self[filename] num = int(q['QUIP']) - yield fmt % (q['Type'][:4], num, num, q['Title'], self.owners(q['Author'])) + name = os.path.splitext(os.path.basename(filename))[0] + yield fmt % (q['Type'][:4], name, num, q['Title'], self.owners(q['Author'])) preamble = """\ QUIP: 0 -- cgit v1.2.3