From nobody Thu Nov 13 22:12:10 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=1582904588; cv=none; d=zohomail.com; s=zohoarc; b=NUzaIjV+x7HIg3daXfTxb/pLpXaNotQn2cGvwoUgT1QQmHHwd7WUPZGbrbGr8UrPZmx5iSUQFVu3g9i7oSJJogabB6e2vRUQLiqOPqeJfsW6yre/i9dHrcJuXdyVOMjIKbeIx8jeiiZb97biFIJcU2G3Pl2+uAKdES8rj9mcyxs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582904588; h=Content-Transfer-Encoding:Cc: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=2CrKzOLXegxkCSm3B7uStBknOAUSCC2J5ztyfqF/dF8=; b=RKB0AcEUyz3WOn4lJU/pHNOftP18XrUnGPSH/TBoo+y4IeEDWX5cJKKTlCSYirr9qjxDnQd4u1mAh3MUB57s2ivICYziHUteZ+YLLa2OBsEIRm75Tf3zU2LSow9PLzk0CKFctjgVE3tfnARHTLods94dLYSqLYQpoi8MwY0Sxq4= 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 1582904588944422.8486246772744; Fri, 28 Feb 2020 07:43:08 -0800 (PST) Received: from localhost ([::1]:48828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7hn9-0004Kf-JH for importer@patchew.org; Fri, 28 Feb 2020 10:43:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46826) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7hh2-0000ts-D6 for qemu-devel@nongnu.org; Fri, 28 Feb 2020 10:36:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7hh1-0004vy-7v for qemu-devel@nongnu.org; Fri, 28 Feb 2020 10:36:48 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:40578) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j7hh1-0004tw-0W for qemu-devel@nongnu.org; Fri, 28 Feb 2020 10:36:47 -0500 Received: by mail-wr1-x435.google.com with SMTP id r17so3419902wrj.7 for ; Fri, 28 Feb 2020 07:36:46 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id u23sm2659452wmu.14.2020.02.28.07.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2020 07:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2CrKzOLXegxkCSm3B7uStBknOAUSCC2J5ztyfqF/dF8=; b=tbgMcmQ5o1b7NV7NmTDfwXLN1wh1m4VKuLKv2MSwn5EZwr2I3oEVHm7Scy2xf3Rdh/ 0iFrEO4lCoawo0cWTWVHNnoEJWCBc60A1Yks6wMsKCJl+ps+Daw9Q72nN2WGIzov7S0X 5uuP3Kas2W3e10BGq+nbI2VABqeyKzOejouJtlsCiXQ8TwO1raSwhifHteIBD1BtPDen GCyM+EVX0g1G7eElZxCFqe+wktGrkxIGE5v78kisIFZdTuPJTOrXBkKD0GsCmTN2XCK2 9WKJa06s9mz0gEZhO9CYH5eQBK3ifJFIFGBDqp/os6r0hiHLzx9QsDiJMmWUrk0OT3/l MYRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2CrKzOLXegxkCSm3B7uStBknOAUSCC2J5ztyfqF/dF8=; b=DWamWupkgaZMDatNOi2kPB3MDcdhNDQI3UAijvo0pV8Jv112dHsOGJMP/hvzAD98lB qcum54EPrLifKPnMbw1l8/ppqvojIxomoLvNv2qJBLqIBdbjl3zyEvTH2YA/EJnjPQ2V zkgXOhk3VXnnYyX7XDGWuvK+FOK0IIpJ3ZF68W+sgG0LjJ9ELvcLC6flmi0StoVy4nmh +MeQCi9BLAsorxZrvefLkfL3pB9w3HbhHPLEYRN3lZs8mMYI+56ASDsxI5xIVF/llNhv iersOT7JYAXG7NuptZn413lzdp6IT3VZgLXbU2WXF8MpB9kJh4FCD5s0AQbzdPMq/rWL +Eng== X-Gm-Message-State: APjAAAWQ3lF/v8S2IoQK8WAcBOic5WUIRk7Jvn7+W3j06wnY4wg5fXvY N9pFOKjqnQHfpdwEGX2AV8W6i8au4RTZGQ== X-Google-Smtp-Source: APXvYqxp1Ne6wRf/vUsm3GWCIkUzvHE7n6uQ6RBp/YlFPrnANVim6iySnbXqLLhbIzlBUxE8R+Z07w== X-Received: by 2002:a5d:4d04:: with SMTP id z4mr5808736wrt.157.1582904205041; Fri, 28 Feb 2020 07:36:45 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 14/33] docs: Create defs.rst.inc as a place to define substitutions Date: Fri, 28 Feb 2020 15:36:00 +0000 Message-Id: <20200228153619.9906-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200228153619.9906-1-peter.maydell@linaro.org> References: <20200228153619.9906-1-peter.maydell@linaro.org> MIME-Version: 1.0 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::435 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: , Cc: Paolo Bonzini , Kashyap Chamarthy Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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 --- 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