Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp2119726rwb; Fri, 5 Aug 2022 13:42:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4rVLd+33n7g1WXLOMu7nY6kVl3R+oWsco/2cGfuhatodgPs0R4iaMs9Zd0UeU8phBZkhSB X-Received: by 2002:a05:6402:d06:b0:440:3e9d:77d with SMTP id eb6-20020a0564020d0600b004403e9d077dmr2519348edb.286.1659732159041; Fri, 05 Aug 2022 13:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659732159; cv=none; d=google.com; s=arc-20160816; b=BR5keBBgFLWpQBsA1Sgwyn00o409leG1bBT5JXnKQDHSKYFIhNli6evWoETz/Vj8EV 4vKlx3VyEw596YTrlrm70bq3Zm0Drz9fm5Z1CxvYDZM/3vGd9v7jMAiILA9ZZNYjvqtS rpAT4rI+GcGXlQG7jTgw9ZINRvrgv+Vjjv2ncEK2hpLPPIB+gCDHMQ3zzgc/TzZ/xjro lmCFLtyMRVVcqHdF89/x+EA/t3T2VgMm67QMRilrQN9wReYWCJZd7wexiwIy6gkG9SFl Hjhn2dnRqXXx41GQ7ub09Xug2m1ne5swAGJz7f31uFzUPqHYIAw7ndx+TpogjCRj4omX Vodw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kPyllzHtdJHiVuQrNO1SiArgGbSeKgOcAwo0xDFb6a0=; b=GOCCo0U5c7tR2J7KYNWNbZgWm25fukrpiRjZwXM6B26pG1mtFwPE1b05cOXZRJqfa8 drhM9X/kDmt6PeNZMF2wrsooJwdHwEqsRfCElPGPj0KK6yF0+8I5GoMMEmYXDhpOUjze piFhFU1TOT4B6gZjt9u5PxdF0wxyKLvsoe/cfCfi4Xu/fcgfNkMdcbA6Qt9THSgxR7Pa fO9wQCfAMgWuYlLyRb0DMGnHtq7j99PzoAj9RHip0oR7RHb/EEW/k1lpqm3Kz/SI+jkC eHLtCUx0ixJzeYqzr7NF14p4FZ88DMgnvUBaeDOhm+aof/LW9Ip3vXy3v0eTl62w6r6V sYiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Bjh87kmm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a27-20020a509b5b000000b0043dcc0d6eb4si513633edj.607.2022.08.05.13.42.13; Fri, 05 Aug 2022 13:42:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Bjh87kmm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232791AbiHEUfP (ORCPT + 99 others); Fri, 5 Aug 2022 16:35:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240175AbiHEUfJ (ORCPT ); Fri, 5 Aug 2022 16:35:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67A36491E3; Fri, 5 Aug 2022 13:35:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E733C61AB9; Fri, 5 Aug 2022 20:35:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 269A5C433B5; Fri, 5 Aug 2022 20:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659731706; bh=zP7E6kgu1qc+50yVif6a7UHQC7yTSPxs4G5vpQLKDFA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Bjh87kmme4lPaWHfOnB8kXIzdZk+rGZPojv46PmRslSv9T60QlgkIBjvthZnQeEoA zGyUxKoeQFd6KQv9g+MCF5uKBrGvUDpwDjCMg1HBPIiqUHFEA2dtZzlKqCdXhj5zZ1 g63R1hcdAP+m7z7soTl/97luvdVhCK6FOHAxIYkDYxDXjjSXB7QLVcHwgWkEyJ7ra2 TJO5g4LKRsl8VGB93lINFJx1kE1c6QjGcTxiKJ1BxKdPwQVb+HrRA9Ys13uPzN6rY/ qMl9XnopP/sZg0+ZY0BCBDYcSGoZKJlIwuvwr3l74SieNh55EpHbV6y1Gr9SeDf9Ti UPe9gezwDIsYw== Date: Fri, 5 Aug 2022 22:35:01 +0200 From: Mauro Carvalho Chehab To: Akira Yokosawa Cc: Jonathan Corbet , Linux Doc Mailing List , Mauro Carvalho Chehab , LKML Subject: Re: [PATCH 2/3] docs/conf.py: Respect env variable LOAD_IMGMATH Message-ID: <20220805223501.27429692@coco.lan> In-Reply-To: References: <12d078f5-6995-b039-7076-bdb1f372a799@gmail.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, 5 Aug 2022 23:24:46 +0900 Akira Yokosawa escreveu: > On some distros with coarse-grained packaging policy, dvipng is > installed along with latex. In such cases, math rendering will > use imgmath by default. It is possible to override the choice by > specifying the option string of "-D html_math_renderer='mathjax'" > to sphinx-build (Sphinx >= 1.8). > > To provide developers an easier-to-use knob, add code for an env > variable "LOAD_IMGMATH" which overrides the automatic choice > of math renderer for html docs. > > LOAD_IMGMATH=yes : Load imgmath even if dvipng is not found > LOAD_IMGMATH=no : Don't load imgmath (fall back to mathjax) I would use a var name starting with SPHINX, like SPHINX_IMGMATH. Anyway, for this entire series: Acked-by: Mauro Carvalho Chehab > > Signed-off-by: Akira Yokosawa > Cc: Mauro Carvalho Chehab > --- > Documentation/conf.py | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > > diff --git a/Documentation/conf.py b/Documentation/conf.py > index 3ec1f845c839..03613eb59578 100644 > --- a/Documentation/conf.py > +++ b/Documentation/conf.py > @@ -128,8 +128,20 @@ autosectionlabel_maxdepth = 2 > # mathjax is the default math renderer since Sphinx 1.8. > have_latex = have_command('latex', '--version', 'pdfTeX') > have_dvipng = have_command('dvipng', '--version', 'dvipng') > -load_imgmath = ((have_latex and have_dvipng) > - or (major == 1 and minor < 8) > +load_imgmath = have_latex and have_dvipng > + > +# Respect LOAD_IMGMATH (for html docs only) > +if 'LOAD_IMGMATH' in os.environ: > + opt_load_imgmath = os.environ['LOAD_IMGMATH'] > + if 'yes' in opt_load_imgmath: > + load_imgmath = True > + elif 'no' in opt_load_imgmath: > + load_imgmath = False > + else: # otherwide, auto selection > + pass > + > +# Always load imgmath for Sphinx <1.8 or for epub docs > +load_imgmath = (load_imgmath or (major == 1 and minor < 8) > or 'epub' in sys.argv) > > if load_imgmath: Thanks, Mauro