From nobody Sun Oct 5 14:30:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1583493239; cv=none; d=zohomail.com; s=zohoarc; b=lOM//NryJLswQus90+nOntIc3upnC70sLvUf1ZWDf4QBiRpiT7TRMZLzD9LMbAEgmiLU6flrsGG8BugfhF9I+vi+OK2wjOmeCRxl1KAB/idrVkVKmQPKMw0A928iMG7KPuHh5DRtWt4Uo1qsgkZNyEpq2r72SXbFgBT3hQGaag4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583493239; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=36WlJxN28gc48Y60J//Z9uSs1fFYmCpC1+7HM1dJn9o=; b=h8mzfDVq+pYRw1SaTvapDleAA59gnjoVELF6aBHYXwOKKDIKPjh9Db0XkCdfVllyKcxx2g2mbPTAlJfARWc95vK/mYRIKHtlTanknWBNJ4mgYay8Q8a6lBeY6YnccfT+5YW9MID6axhVl1glAG6fNX1WwPhJDENF2i9c/GHRv60= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583493239454520.8981439906406; Fri, 6 Mar 2020 03:13:59 -0800 (PST) Received: from localhost ([::1]:34804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAAvW-0001Xq-6g for importer@patchew.org; Fri, 06 Mar 2020 06:13:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39336) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAAs5-0003h2-U8 for qemu-devel@nongnu.org; Fri, 06 Mar 2020 06:10:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAAs3-00054Y-H1 for qemu-devel@nongnu.org; Fri, 06 Mar 2020 06:10:24 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:36995) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jAAs3-00053O-9t for qemu-devel@nongnu.org; Fri, 06 Mar 2020 06:10:23 -0500 Received: by mail-wm1-x331.google.com with SMTP id a141so1929976wme.2 for ; Fri, 06 Mar 2020 03:10:23 -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.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2020 03:10:21 -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=36WlJxN28gc48Y60J//Z9uSs1fFYmCpC1+7HM1dJn9o=; b=ak+8DvzhiZvhENdwh5Py4WpFtOc2fUfUCuKIz1BwzJ3Wl4SPuXv2LKIm+GdzaQaOLW XUZ3jZIxuIeDubwm0ttYbnhIe1mV2I6cD++MGD/sbTN3yxh6e240JhMk6mwb3BHJZjbF yvTa+81Fbk7aUtNm9SvEJuDpcRtuNrwHIrNfH3sUE34PeopWtYxY9aJPceWn6G8t+Dbw CiZDymQG8607F5WBBj9SIuxPv6RGZl+vdaAQIEIPKJIs0D2i0WiBZv53qWIVQ8vP7Gp8 UQcPSqGvmUVT6SYuAM+sMkFXxJDdeMrZyRVJecXmjS8weX36OFnbiGb5G0aPe69Ab18w Fzvg== 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=36WlJxN28gc48Y60J//Z9uSs1fFYmCpC1+7HM1dJn9o=; b=CPfyjjetL+OVEVTuFPnTpqbwmIztuSfqY4sICTm81q3WRaoGArvgMqOfTAa7Y5STgJ 9z1DIVyqnI17uen1g72IhFBBrqqJZB1Kfix7FORh7CEaBajoirWHbr7qqmTEAetEA0Iu LybjLyJMMSy7ASAhyag6hK3T24dPJNk40KwWhu9BgU1/sojRw9jGrLrLxVPAJz31/4MV I8nAYvFljMzr1oTrE4Gk/lSaIr0eKG2DyY/KD1K08fHTSbQEG8sIim5xvYnNse8dnLAA 9/xJ6CJ9i9afnZVKJ4PJVT8r7jE+wt3TT20JYCJpeJ1OvHq9rTgidXHBwsq490owLJ/l rItA== X-Gm-Message-State: ANhLgQ0lLqArEx0n4aDy85Fp3ljoGSAMg94WlYbv+fgTSgM/YTnLDj53 wTJn76ZFJCKaVF+kz7WA9vGZXrO446UBIg== X-Google-Smtp-Source: ADFU+vvLfvULZ7Y61jfe0HQbl4kSjd43l8+uP5yecWGPijgkh4NepNKlFWPIyW8x2EiPhGC+2GUgdA== X-Received: by 2002:a05:600c:404a:: with SMTP id j10mr3503256wmm.33.1583493021967; Fri, 06 Mar 2020 03:10:21 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/33] docs: Create defs.rst.inc as a place to define substitutions Date: Fri, 6 Mar 2020 11:09:40 +0000 Message-Id: <20200306110959.29461-15-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Rather than accumulating generally useful rST substitution definitions in individual rST files, create a defs.rst.inc where we can define these. To start with it has the |qemu_system| definition from qemu-block-drivers.rst. Add a comment noting a pitfall where putting literal markup in the definition of |qemu_system| makes it misrender manpage output; this means the point-of-use must handle the literal markup (which is almost always done by having it inside a parsed-literal block). Signed-off-by: Peter Maydell Reviewed-by: Kashyap Chamarthy Tested-by: Alex Benn=C3=A9e Message-id: 20200228153619.9906-15-peter.maydell@linaro.org --- Makefile | 1 + docs/conf.py | 6 ++++++ docs/defs.rst.inc | 11 +++++++++++ docs/system/qemu-block-drivers.rst | 2 -- 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 docs/defs.rst.inc diff --git a/Makefile b/Makefile index 7e60a435426..26bbd334438 100644 --- a/Makefile +++ b/Makefile @@ -1052,6 +1052,7 @@ sphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \ build-manual =3D $(call quiet-command,CONFDIR=3D"$(qemu_confdir)" $(SPHINX= _BUILD) $(if $(V),,-q) -W -b $2 -D version=3D$(VERSION) -D release=3D"$(FUL= L_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_BUILDDIR)/$1 ,"= SPHINX","$(MANUAL_BUILDDIR)/$1") # We assume all RST files in the manual's directory are used in it manual-deps =3D $(wildcard $(SRC_PATH)/docs/$1/*.rst) \ + $(SRC_PATH)/docs/defs.rst.inc \ $(SRC_PATH)/docs/$1/conf.py $(SRC_PATH)/docs/conf.py # Macro to write out the rule and dependencies for building manpages # Usage: $(call define-manpage-rule,manualname,manpage1 manpage2...[,extra= deps]) diff --git a/docs/conf.py b/docs/conf.py index 7588bf192ee..960043cb860 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -132,6 +132,12 @@ suppress_warnings =3D ["ref.option"] # style document building; our Makefile always sets the variable. confdir =3D os.getenv('CONFDIR', "/etc/qemu") rst_epilog =3D ".. |CONFDIR| replace:: ``" + confdir + "``\n" +# We slurp in the defs.rst.inc and literally include it into rst_epilog, +# because Sphinx's include:: directive doesn't work with absolute paths +# and there isn't any one single relative path that will work for all +# documents and for both via-make and direct sphinx-build invocation. +with open(os.path.join(qemu_docdir, 'defs.rst.inc')) as f: + rst_epilog +=3D f.read() =20 # -- Options for HTML output ---------------------------------------------- =20 diff --git a/docs/defs.rst.inc b/docs/defs.rst.inc new file mode 100644 index 00000000000..ae80d2f35d8 --- /dev/null +++ b/docs/defs.rst.inc @@ -0,0 +1,11 @@ +.. + Generally useful rST substitution definitions. This is included for + all rST files as part of the epilogue by docs/conf.py. conf.py + also defines some dynamically generated substitutions like CONFDIR. + + Note that |qemu_system| is intended to be used inside a parsed-literal + block: the definition must not include extra literal formatting with + ``..``: this works in the HTML output but the manpages will end up + misrendered with following normal text incorrectly in boldface. + +.. |qemu_system| replace:: qemu-system-x86_64 diff --git a/docs/system/qemu-block-drivers.rst b/docs/system/qemu-block-dr= ivers.rst index 7ca890ea23a..bd99d4fa8eb 100644 --- a/docs/system/qemu-block-drivers.rst +++ b/docs/system/qemu-block-drivers.rst @@ -3,8 +3,6 @@ QEMU block drivers reference =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =20 -.. |qemu_system| replace:: qemu-system-x86_64 - Synopsis -------- =20 --=20 2.20.1