Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3930110ybi; Mon, 15 Jul 2019 01:03:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqw64oex/VEP7auGGJ8CINlPn3afZBUqYWmLpDGZo+26vTR7koD9sHjOcv2Y22bAPS5bStZO X-Received: by 2002:a17:90a:6097:: with SMTP id z23mr27974760pji.75.1563177797141; Mon, 15 Jul 2019 01:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563177797; cv=none; d=google.com; s=arc-20160816; b=iFp+arth2WY6iHw6T/YPuQq+axL1pel+0KLVa8yKVTd7TKRiA7EwZFMCXmZR/WpT/q v04uWhKKF02F957hSz9h0GzHTJu+gZcW4Dr7PK+ypAL8NJO44Eq+KvxpRxlozkfISNJJ aVjxvCnSvfvl48p314mPg2UdTc5fmKYWGW/NV7hYog60OTrmcu0kP8htvv6T2jKfaPxH AqQ84P9+Upl6f9+6/H3JGR1mUqtsQVNVw1Ph+sA8uBBFddOiUbtsbOWnC8YEVs1MQidI E9f+L90NfGasMeYIR/yESTS5RLTAQ4QVMvVICTn290rHruiqZF02vd6IiK3+Lt9nE2Nj UC2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=cr2TH0iYJZYePVXQlayUtWSyHforlPXZ1/Qdq3ZeKpk=; b=sy+ZmLhSC2AEm7ZTDR/RVQ1KPF7klLgRjFsyPP9F9JxgbaZ8smyHh5JJM2yDtPZnHg g9HCtlHz2XmdUK+WrSaaD/rs1c98fsn16UI1mkvS6IlQNUib8RcokHpzeiomFbcUeBug pcU2kHcufaZN3bEDz/GFBGZ0KAQ+2c8pekx7PHGeNnw05Gk/P4YoedF1u1xdzIKcMg5S aUG63bTOaTwReS4sEJtWOa7fsCXocGs88gbBgmXj80VsmliC5qjuj/9M/yqarj7pHSSM +8Pm1okQsdh499AWwqTTfbvVQr14L8i3A0N7V8gP9jB6+rva0coW0ZnJ3O33vY5hJyki 1OPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=svc9M6QN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si14832340plg.71.2019.07.15.01.03.00; Mon, 15 Jul 2019 01:03:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=svc9M6QN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729377AbfGOIBZ (ORCPT + 99 others); Mon, 15 Jul 2019 04:01:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35002 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726170AbfGOIBY (ORCPT ); Mon, 15 Jul 2019 04:01:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=cr2TH0iYJZYePVXQlayUtWSyHforlPXZ1/Qdq3ZeKpk=; b=svc9M6QN7+u3C+N6eOPZC4IB2 aq4dQ5WyLBMh3FW6SPTS6cXA0DGGm0v+nVfBD36mCJ5ikL8c8zu+x7ebEggxTTlPDw+WJpXmFfD65 yQzBSRpTKD+ZidpNa4zFhrJCZMVXQtci38d1rb+IYhQ2u7UkT6k5tNZ3zwLUT2AVZqAjSeiw2c/sm rfs+st2BDAVopdVErU5iCuVSG5+cCH/1YcSFl9DZYLRGFVL9bNbfDAr35w4x8k823ThOpUgZtRSX+ nVpjbmQW+HiM1IX2g7PpoRM8Pzae/oKFDPmHYdeHNTE/Z+nOJvmZUBqFTzjMxidxX0f3MSJ6iRF9A 6qREJvBmA==; Received: from [189.27.46.152] (helo=coco.lan) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hmvvI-0008Ju-4t; Mon, 15 Jul 2019 08:01:24 +0000 Date: Mon, 15 Jul 2019 05:01:20 -0300 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH v2 7/8] docs: load_config.py: avoid needing a conf.py just due to LaTeX docs Message-ID: <20190715050120.6eeef30b@coco.lan> In-Reply-To: <8076229480bdec3e86489d43b10a5afcfd88a75e.1563115732.git.mchehab+samsung@kernel.org> References: <8076229480bdec3e86489d43b10a5afcfd88a75e.1563115732.git.mchehab+samsung@kernel.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Right now, for every directory that we need to have LaTeX output, a conf.py file is required. That causes an extra overhead and it is actually a hack, as the latex_documents line there are usually a copy of the ones that are there already at the main conf.py. So, instead, re-use the global latex_documents var, just adjusting the path to be relative ones. Signed-off-by: Mauro Carvalho Chehab --- v2: make SPHINXDIRS="foo" htmldocs now works without needing a per-subdir conf.py. diff --git a/Documentation/sphinx/load_config.py b/Documentation/sphinx/load_config.py index 301a21aa4f63..e4a04f367b41 100644 --- a/Documentation/sphinx/load_config.py +++ b/Documentation/sphinx/load_config.py @@ -21,6 +21,29 @@ def loadConfig(namespace): and os.path.normpath(namespace["__file__"]) != os.path.normpath(config_file) ): config_file = os.path.abspath(config_file) + # Let's avoid one conf.py file just due to latex_documents + start = config_file.find('Documentation/') + if start >= 0: + start = config_file.find('/', start + 1) + + end = config_file.rfind('/') + if start >= 0 and end > 0: + dir = config_file[start + 1:end] + + print("source directory: %s" % dir) + new_latex_docs = [] + latex_documents = namespace['latex_documents'] + + for l in latex_documents: + if l[0].find(dir) == 0: + has = True + fn = l[0][len(dir) + 1:] + new_latex_docs.append((fn, l[1], l[2], l[3], l[4])) + break + + namespace['latex_documents'] = new_latex_docs + + # If there is an extra conf.py file, load it if os.path.isfile(config_file): sys.stdout.write("load additional sphinx-config: %s\n" % config_file) config = namespace.copy() @@ -29,4 +52,6 @@ def loadConfig(namespace): del config['__file__'] namespace.update(config) else: - sys.stderr.write("WARNING: additional sphinx-config not found: %s\n" % config_file) + config = namespace.copy() + config['tags'].add("subproject") + namespace.update(config)