From patchwork Fri Mar 6 11:09:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 184265 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp7299879ile; Fri, 6 Mar 2020 03:17:04 -0800 (PST) X-Google-Smtp-Source: ADFU+vtXwhh5RCN08C+1mhqF30lwFE9xWmjT7RJOkS0+5Iurd5549Se6uEKlrf8ySHllNLmAGhir X-Received: by 2002:ad4:480f:: with SMTP id g15mr2290559qvy.247.1583493424539; Fri, 06 Mar 2020 03:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583493424; cv=none; d=google.com; s=arc-20160816; b=xSaIxv+9UaszcRRhesh24j8iTz7xYP+vzM1AUt0HTgQQ/hMs+RWNbB3YRsY73hRKar si2tOeblPedWEad0aVxaxXwXa0ZlXVZmmUAXYEybw7nNUQqi7ryGHX6V0xkJADP3zMbW faUJ7e6QgtmDL7bJ7lUQG29F3AeYUBOmcQ5m9rFD1cbnidZ97mDrL90rFhUT01rq4I0k PziGB7Gjnj8nCWnU9wrOqU5fD3ZUDkLmsJggko8O2+C8J97uEFzzHBi7DlSEZykhPsY5 dWpodUjyutswL8KbqrUb5lmpeCmHa/P7r+Ll9WSUBuRH96S2Adav7FyfxEN0O1NoTllO uTSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=nwDKZHHvTc1aVEH0nGRr033YOq+xaIEkMAUFu/T4EaE=; b=ECioaHMGsr71XWMCo3Ob9w6b4eN5kJQAboqFv1dq9bXt69TNM5QN0mN6suO8hRn3ZQ lf9hLvHDo4RIylwtRJqWJOfNRtFjBOIglGPfRV3iHXYEeOmFypp8+QzYWeskXhPusVJS /7O7G+irbjKY273hDn/vWZrs2voClnJ98PixaiD5o+dB8nZkytUu66OVgvo/EYCoYipE 73TeCC6/qo2AHJq227ghffw/S1hiAvzsifclWBf9+rX0SGwxsme+VVhNAbRrNX5SuA2U Leq/uLhA6CRUMIgSz7jKjmjV1ZejpJXHb2KaA/Ezz+UOB1otaEmYHbeaqNsZ46YuIk/+ iLtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SLV2a73B; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m16si1144976qka.299.2020.03.06.03.17.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Mar 2020 03:17:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SLV2a73B; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAAyV-0006yj-BH for patch@linaro.org; Fri, 06 Mar 2020 06:17:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39804) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAAsN-0004AV-Gh for qemu-devel@nongnu.org; Fri, 06 Mar 2020 06:10:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAAsI-0005fJ-5R for qemu-devel@nongnu.org; Fri, 06 Mar 2020 06:10:39 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:35576) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jAAsH-0005cf-SW for qemu-devel@nongnu.org; Fri, 06 Mar 2020 06:10:38 -0500 Received: by mail-wm1-x331.google.com with SMTP id m3so1937287wmi.0 for ; Fri, 06 Mar 2020 03:10:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=nwDKZHHvTc1aVEH0nGRr033YOq+xaIEkMAUFu/T4EaE=; b=SLV2a73BLGk64Vok3tBpLicIgp068BbQC7b88H4U2CLdl37REX7pCYCI7kk2tAyqSV 4mrA7LH4V+WBI/b8ILDxXybOhTmFCeaL8Cv7zeANZqCatKh9bVnS19T56MxJx6NbwDEv JDyFecaTjAq70bjo8qzbXdPLzQWBxFGA0nJnKFxNF2iqCWhPmcpYZ9zR3XBHjQ3gY6r2 9NUqoLHsPGwwR1pdp44Mks+3ETlWjzWdqRGCbRhcYUhlntw/4saJREXLE9IdgMUMkWxU NlpbT6Kig95wzTNCnpNiS+FObAdp2F2+JuCOEJhl6AosY80kG0UO4mIXvwev77cVpfRD NVZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nwDKZHHvTc1aVEH0nGRr033YOq+xaIEkMAUFu/T4EaE=; b=YlFqonA71i2xTafIF0vY4qisGUwp5g6Rme4wt5vmtx0e7NxrCtHqhqhkNuhcWbe42G sBxcLapCI4cQKbnPtRXbV3iuBB98xVHI6iJz7QoF3TmwYXLiWUyweEceBWGE0sMVtab7 wguVsuD+33e4W3/dWd+KRRIlLRI3SX+zat0cr046SdqUQ3RiCBLLxkxi8Kd5TYCFXyl6 82IaLeyT9gVxCyP/XjVUdHNTk9h32PMAttPFy7UNaj9lCsbUiKwzGiU/+TAQ9gCjt67S OgCjbnFUhjvsCVgB6ZRjHPa1szwGrN6l9EOILleRvrTJErAyCjgsDoe0eXBRc6RDhPcE oBZQ== X-Gm-Message-State: ANhLgQ0v2mezBlXtpZnZ6JB+EuGpfE3jsmXDt8ghNW9tDqGdCf3K9ezS FDhSgsgIABO4JiHg+m/YvKi0GYV82cn2Ig== X-Received: by 2002:a1c:8041:: with SMTP id b62mr3413828wmd.76.1583493034579; Fri, 06 Mar 2020 03:10:34 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id y10sm12553029wma.26.2020.03.06.03.10.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2020 03:10:33 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/33] doc/scripts/hxtool.py: Strip trailing ':' from DEFHEADING/ARCHHEADING Date: Fri, 6 Mar 2020 11:09:48 +0000 Message-Id: <20200306110959.29461-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200306110959.29461-1-peter.maydell@linaro.org> References: <20200306110959.29461-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::331 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Alex Bennée Tested-by: Alex Bennée Message-id: 20200228153619.9906-23-peter.maydell@linaro.org --- docs/sphinx/hxtool.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.20.1 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)