Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1661696rwb; Fri, 19 Aug 2022 07:24:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uQROILZGVDdvFGpfbx+ASCfFb3u46/HJI1EDLkrOzbyaiDpURqHavlunn8NS4BCYzhxhm X-Received: by 2002:a17:907:7f05:b0:730:e4ad:e5df with SMTP id qf5-20020a1709077f0500b00730e4ade5dfmr4891110ejc.663.1660919071303; Fri, 19 Aug 2022 07:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660919071; cv=none; d=google.com; s=arc-20160816; b=oHH684NfLhL/nbYZI43HUBz1PDPislcDbqQuspJ6lOnSkY5I5ZfMiX2cclJp2SeQUx CaT9rzR4s+VqIfAQrvVmW4NT5PYDNpEf42TZtM4r5ZFX0qpJzgzzO/OwunPVMBXLaPfp cIHt3XtcdyO9E8/ZMUkN294NdUKpI/gjfdOU0se5IzH4IFeNpdP6pfWIEKY7vNz3XUMc RSIFDG4GpIo95qz9Jgbri/gxfm9la+B3XhjK8YRx74i2lGS9LttqIpnXvBZ/uEPmxO9l +t6lkB+98/oyGj54AX+iDZQfPvbGyeom7a/cvAQ+JtQwEyfw+hxFfzuFb8qM+iUi6S/n Gfww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=pM8ZJI/a5osYIF/nQOcgseoNb81Y3Rd7dvH59J/Ahok=; b=lhmGGSnjZi5yeHtNlh+lFWn9nfWhapDDrDkaZDfi3mgoyGRyW9UNdeg4apuYyCXT4+ GAfXtSzQFmHV1pBWxUybMZoLSTLI3nZjyTd19hGjkzfMbScmgN/nVE7KDXH2R4TDMIqx iDOUIWeD7Q4/FMibXAkKo03OxHlXVaEnmiynczmAdYQ5hu2ov+CEN+g40MRE5fwldsmk gay+aDaUnjkigmaFW/FELWLWdmxhRPvg/OkbLqReQPuMx8qJdNiAnhj7ZXeJkHbNTKpk hXhn3VQT2hYbgp1/rueabgSlXCNMswVT1EtlPaAb8boegUNS5P0HVSjDsrBmXgrz8d4w OtSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oKldQBto; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di15-20020a170906730f00b00730462ddd4fsi3438735ejc.542.2022.08.19.07.24.04; Fri, 19 Aug 2022 07:24:31 -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=@gmail.com header.s=20210112 header.b=oKldQBto; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349481AbiHSNvM (ORCPT + 99 others); Fri, 19 Aug 2022 09:51:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349484AbiHSNvH (ORCPT ); Fri, 19 Aug 2022 09:51:07 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B797FF8C6; Fri, 19 Aug 2022 06:51:05 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id pm17so4671381pjb.3; Fri, 19 Aug 2022 06:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=pM8ZJI/a5osYIF/nQOcgseoNb81Y3Rd7dvH59J/Ahok=; b=oKldQBtonVmXYKT6Gffc1b8O1gvRh/MV148KWXuIGHLDyDUM2UrPtyuY7gkp5Uv794 ESPzhNQw73D41On23DCyO6UWCzrL6LhWcWRj6PYVc9ztXQlWJkIqoLeEn7z79XqE5yd+ UFM/1jfGNnIvW/zZ6D5QUnw2qqiYTAOBivfW4o6uyHY/YI6otWN9Eovcl7BDU25aTNsX ErEThCKm6SwhoH8/zhouYV66B2STCJbTRfOirwcMela9ifmucje2r6nu9VO6U3svrEN0 sujf/kHgTUKaWJ/xbEqDHnSFnXglEkNYp8x+dpmP53Irh2YkDwk6EqvujvoM0YjeDdMv Wx5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=pM8ZJI/a5osYIF/nQOcgseoNb81Y3Rd7dvH59J/Ahok=; b=lINeyqYQYgRevrAabgCgrM5dAUmeUiAz5/kv1e2CdKioB+gZmyuIxRPrUuLAxUIiL8 jF3bbpxB3xpCh2VjqVNvaGaorijZSWOeZjUlKdzvxBQc4xKRygwoDJLXlWEg3dimmucp 5IEOFy41GoFsNLiFB0m+e4tzsP9X+mU9+bSLWOrNcBBSRri1Ac8Hju5XlBWlACfGm++l 99rv/D3R6GFJ2YtnKYFbrW9bXLk5SxY6IGE+ttBj/NIQ3GfIQ2uVqGgzQpnMseme3uFG NiL3wRtrM4XAw8oxxGI9uDIiuDOBjtkxKZKOuQr9qeSto5WmXmf6f3Vj6JkxoMvdZ+Ur OtnQ== X-Gm-Message-State: ACgBeo0Fo4IWVtJ0klr1ilDMOztbHLfLASJRwyaZN3EEIkcWw8COuW7p pt29Yxk6o3oGfbXjSVP8E3tZFv1ZZdE= X-Received: by 2002:a17:902:da92:b0:16e:f4a4:9f93 with SMTP id j18-20020a170902da9200b0016ef4a49f93mr7408622plx.27.1660917065043; Fri, 19 Aug 2022 06:51:05 -0700 (PDT) Received: from [192.168.11.9] (KD106167171201.ppp-bb.dion.ne.jp. [106.167.171.201]) by smtp.gmail.com with ESMTPSA id i9-20020a170902c94900b001641b2d61d4sm3239153pla.30.2022.08.19.06.51.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Aug 2022 06:51:04 -0700 (PDT) Message-ID: Date: Fri, 19 Aug 2022 22:50:59 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 1/3] docs/conf.py: Treat mathjax as fallback math renderer Content-Language: en-US To: Jonathan Corbet Cc: linux-doc@vger.kernel.org, Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Akira Yokosawa References: <87wnb5bh67.fsf@meer.lwn.net> From: Akira Yokosawa In-Reply-To: <87wnb5bh67.fsf@meer.lwn.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,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 On Thu, 18 Aug 2022 11:22:24 -0600, Jonathan Corbet wrote: > Akira Yokosawa writes: > >> Currently, math expressions using the "math::" directive or >> the ":math:" role of Sphinx need the imgmath extension for proper >> rendering in html and epub builds. >> imgmath requires dvipng (and latex). >> Otherwise, "make htmldocs" will complain of missing commands. >> >> As a matter of fact, the mathjax extension is loaded by default since >> Sphinx v1.8 and it is good enough for html docs without any dependency >> on texlive packages. >> >> Stop loading the imgmath extension for html docs unless requirements >> for imgmath are met. >> >> For epub docs, keep the same behavior of always loading imgmath. >> >> Signed-off-by: Akira Yokosawa >> Acked-by: Mauro Carvalho Chehab >> --- >> Changes sinve v1: >> - Acked-by from Mauro >> >> -- >> Documentation/conf.py | 34 +++++++++++++++++++++++++++++++++- >> 1 file changed, 33 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/conf.py b/Documentation/conf.py >> index 934727e23e0e..3ec1f845c839 100644 >> --- a/Documentation/conf.py >> +++ b/Documentation/conf.py >> @@ -15,6 +15,23 @@ >> import sys >> import os >> import sphinx >> +from subprocess import check_output >> + >> +# helper >> +# ------ >> + >> +def have_command(cmd, ver_opt, str_in_ver): >> + """Run ```cmd`` with ``ver_opt`` and see if ``str_in_ver`` is found >> + or not. >> + """ >> + >> + try: >> + ver_str = check_output([cmd, ver_opt]).decode('utf-8', 'ignore') >> + have_cmd = str_in_ver in ver_str >> + except: >> + have_cmd = False >> + >> + return have_cmd > > So this is adding infrastructure that isn't really mentioned in the > changelog. Sorry for missing it. > > A more fundamental comment, though, is that I have learned (the hard > way, repeatedly) that good things do not come from bare "except" > statements. They always hide bugs. If there is an exception you're > worried about here, please list it explicitly. I see. Thank you for the insightful tip. I'm more inclined to use the simpler approach of the "which()" function defined in sphinx/kfigure.py, which is free of try-except constructs. Will respin this along with the fix of 2/3 in a couple of days. Thanks, Akira > > Otherwise seems good. > > Thanks, > > jon