[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 22/33] doc/scripts/hxtool.py: Strip trailing ':' from DEFHEADI
From: |
Peter Maydell |
Subject: |
[PATCH v3 22/33] doc/scripts/hxtool.py: Strip trailing ':' from DEFHEADING/ARCHHEADING |
Date: |
Fri, 28 Feb 2020 15:36:08 +0000 |
In hxtool files, section headings defined with the DEFHEADING
and ARCHHEADING macros have a trailing ':'
DEFHEADING(Standard options:)
This is for the benefit of the --help output. For consistency
with the rest of the rST documentation, strip any trailing ':'
when we construct headings with the Sphinx hxtool extension.
This makes the table of contents look neater.
This only affects generation of documentation from qemu-options.hx,
which we will start doing in a later commit.
Signed-off-by: Peter Maydell <address@hidden>
---
docs/sphinx/hxtool.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/docs/sphinx/hxtool.py b/docs/sphinx/hxtool.py
index 5d6736f3002..7dd223fe362 100644
--- a/docs/sphinx/hxtool.py
+++ b/docs/sphinx/hxtool.py
@@ -60,8 +60,9 @@ def parse_defheading(file, lnum, line):
# empty we ignore the directive -- these are used only to add
# blank lines in the plain-text content of the --help output.
#
- # Return the heading text
- match = re.match(r'DEFHEADING\((.*)\)', line)
+ # Return the heading text. We strip out any trailing ':' for
+ # consistency with other headings in the rST documentation.
+ match = re.match(r'DEFHEADING\((.*?):?\)', line)
if match is None:
serror(file, lnum, "Invalid DEFHEADING line")
return match.group(1)
@@ -72,8 +73,9 @@ def parse_archheading(file, lnum, line):
# though note that the 'some string' could be the empty string.
# As with DEFHEADING, empty string ARCHHEADINGs will be ignored.
#
- # Return the heading text
- match = re.match(r'ARCHHEADING\((.*),.*\)', line)
+ # Return the heading text. We strip out any trailing ':' for
+ # consistency with other headings in the rST documentation.
+ match = re.match(r'ARCHHEADING\((.*?):?,.*\)', line)
if match is None:
serror(file, lnum, "Invalid ARCHHEADING line")
return match.group(1)
--
2.20.1
- [PATCH v3 10/33] qemu-doc: move qemu-tech.texi into main section, (continued)
- [PATCH v3 10/33] qemu-doc: move qemu-tech.texi into main section, Peter Maydell, 2020/02/28
- [PATCH v3 11/33] qemu-doc: move included files to docs/system, Peter Maydell, 2020/02/28
- [PATCH v3 12/33] qemu-doc: remove indices other than findex, Peter Maydell, 2020/02/28
- [PATCH v3 14/33] docs: Create defs.rst.inc as a place to define substitutions, Peter Maydell, 2020/02/28
- [PATCH v3 17/33] docs/system: convert managed startup to rST., Peter Maydell, 2020/02/28
- [PATCH v3 18/33] docs/system: convert the documentation of deprecated features to rST., Peter Maydell, 2020/02/28
- [PATCH v3 08/33] qemu-doc: split target sections to separate files, Peter Maydell, 2020/02/28
- [PATCH v3 09/33] qemu-doc: Remove the "CPU emulation" part of the "Implementation notes", Peter Maydell, 2020/02/28
- [PATCH v3 16/33] docs/system: Convert security.texi to rST format, Peter Maydell, 2020/02/28
- [PATCH v3 05/33] qemu-doc: split qemu-doc.texi in multiple files, Peter Maydell, 2020/02/28
- [PATCH v3 22/33] doc/scripts/hxtool.py: Strip trailing ':' from DEFHEADING/ARCHHEADING,
Peter Maydell <=
- [PATCH v3 21/33] hmp-commands-info.hx: Add rST documentation fragments, Peter Maydell, 2020/02/28
- [PATCH v3 24/33] docs: Roll -prom-env and -g target-specific info into qemu-options.hx, Peter Maydell, 2020/02/28
- [PATCH v3 13/33] docs/system: put qemu-block-drivers body in an included file, Peter Maydell, 2020/02/28
- [PATCH v3 25/33] scripts/hxtool-conv: Archive script used in qemu-options.hx conversion, Peter Maydell, 2020/02/28
- [PATCH v3 20/33] hmp-commands.hx: Add rST documentation fragments, Peter Maydell, 2020/02/28
- [PATCH v3 27/33] qemu-options.hx: Fix up the autogenerated rST, Peter Maydell, 2020/02/28
- [PATCH v3 30/33] ui/cocoa.m: Update documentation file and pathname, Peter Maydell, 2020/02/28
- [PATCH v3 29/33] docs: Generate qemu.1 manpage with Sphinx, Peter Maydell, 2020/02/28
- [PATCH v3 19/33] docs/system: convert Texinfo documentation to rST, Peter Maydell, 2020/02/28
- [PATCH v3 31/33] docs: Stop building qemu-doc, Peter Maydell, 2020/02/28