All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: corbet@lwn.net, ksummit-discuss@lists.linuxfoundation.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	mchehab+huawei@kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: Expectation to --no-pdf option (was Re: [PATCH v2 0/5] Address some issues with sphinx detection)
Date: Fri, 8 Jul 2022 20:34:00 +0900	[thread overview]
Message-ID: <3ba5a52e-cab6-05cf-a66e-adc58c467e1f@gmail.com> (raw)
In-Reply-To: <20220707211558.438a27d4@sal.lan>

On Thu, 7 Jul 2022 21:15:58 +0100, Mauro Carvalho Chehab wrote:
> Em Tue, 5 Jul 2022 13:15:57 +0900
> Akira Yokosawa <akiyks@gmail.com> escreveu:
> 
>> Hi Mauro,
>>
[...]

>> So this is a meta-level feedback considering the most likely uses
>> of sphinx-pre-install.
>>
>> I think first-time users of sphinx-pre-install are more likely
>> interested in getting ready for running "make html".  They won't
>> bother with "make pdfdocs". 
> 
> True, but, as you're pointing below, math expressions require LaTeX.
> 
> The idea of using --no-pdf is to setup an environment without LaTeX,
> meaning that math tags would only be partially parsed: basically, the
> output would be html with LaTeX-like math expressions (at least last
> time I tried).

Oh, that is your intention.  :-/

When I saw this help text in "./scripts/sphinx-pre-install --help":

    --no-pdf	- don't check for dependencies required to build PDF docs

for the first time, my expectation was like this:

    If I make "./scripts/sphinx-pre-install --no-pdf" happy, "make htmldocs"
    will complete without any warning on package requirements.

But I got this warning from "make htmldocs" among others:

    WARNING: dvipng command 'dvipng' cannot be run (needed for math display), check the imgmath_dvipng setting

And my reaction to it was something like:

    "What!!!  Why sphinx-pre-install didn't complain?"
    "OK. I'll ignore sphinx-pre-install.  Let's see what I need to install."

The reason why this mismatch has never surfaced as a problem is, I suppose,
because most people don't use --no-pdf at all.

However, in thinking of making --no-pdf the default, I thought --no-pdf
should be more trustworthy.

If your goal is to provide LaTeX-free packages for "make htmldocs",
the option should have been named --no-latex or similar (probably in
addition to --no-pdf), no?

Well, arguing does not help. I stop here.

More constructive approach would be to make "make htmldocs" be
truly latex-free.  Then --no-pdf and --no-latex will be equivalent.

Fortunately, it is possible by using the mathjax extension instead of
imgmath.  With mathjax, rendering of math expressions is delegated to
web browsers.

The resulting HTML will depend on mathjax code and math fonts from
somewhere in the cloud (by default, https://cdnjs.cloudflare.com/ajax/libs/mathjax/...
or https://cdn.jsdelivr.net/npm/mathjax@3/... depending on the Sphinx
version).

All you need is this one-liner:

--------
diff --git a/Documentation/conf.py b/Documentation/conf.py

index 934727e23e0e..fe1084510329 100644

--- a/Documentation/conf.py

+++ b/Documentation/conf.py

@@ -106,7 +106,7 @@ else:

 autosectionlabel_prefix_document = True

 autosectionlabel_maxdepth = 2

 

-extensions.append("sphinx.ext.imgmath")

+extensions.append("sphinx.ext.mathjax")

 

 # Add any paths that contain templates here, relative to this directory.

 templates_path = ['_templates']
--------

In my tests, the mathjax extension works with all the versions of Sphinx
I tested (1.7.9, 2.4.4, 3.4.3 (debian bullseye), 4.2.0 (openSUSE LEAP 15.4),
and 5.0.2).
Note that math expressions should look much sharper (vector fonts)
than those from imgmath (pixel images).
The time for a browser to complete the rendering might be longer than
with imgmath, especially for pages with a lot of math expressions,
though.  (Yes, I see some of media documents have a lot of them.)

When you are detached from network connections, browsers will give
up and show those expressions in mathjax source code.

Mauro, wouldn't this approach work for you?

        Thanks, Akira

PS: Replies to the other topics will be sent separately.

  reply	other threads:[~2022-07-08 11:34 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 20:57 [TECH TOPIC] What kernel documentation could be Jonathan Corbet
2022-06-17 20:57 ` [Ksummit-discuss] " Jonathan Corbet
2022-06-17 21:48 ` Laurent Pinchart
2022-06-17 21:48   ` Laurent Pinchart
2022-06-27 15:18   ` Jonathan Corbet
2022-06-18  8:24 ` Mauro Carvalho Chehab
2022-06-18  8:24   ` Mauro Carvalho Chehab
2022-06-18 11:03   ` Miguel Ojeda
2022-06-18 11:16     ` Mauro Carvalho Chehab
2022-06-18 11:16       ` Mauro Carvalho Chehab
2022-06-18 14:37       ` Miguel Ojeda
2022-06-23  9:18   ` Jani Nikula
2022-06-23  9:57     ` Mauro Carvalho Chehab
2022-06-23 10:30       ` Jani Nikula
2022-06-23 13:40       ` Jonathan Corbet
2022-06-24  7:33         ` Mauro Carvalho Chehab
2022-06-24 16:37           ` Markus Heiser
2022-06-27 15:27             ` Jonathan Corbet
2022-06-27 15:31               ` Christoph Hellwig
2022-06-28  7:43               ` Mauro Carvalho Chehab
2022-06-28  7:57                 ` Geert Uytterhoeven
2022-06-28 11:01                   ` Mauro Carvalho Chehab
2022-07-02 12:43                     ` Stephen Rothwell
2022-06-24 22:57           ` Jonathan Corbet
2022-06-25  9:10             ` Mauro Carvalho Chehab
2022-06-25 14:00               ` Jonathan Corbet
2022-06-25 18:11                 ` Linus Torvalds
2022-06-26  7:55                   ` Mauro Carvalho Chehab
2022-06-26  9:26                     ` Mauro Carvalho Chehab
2022-06-26  9:53                     ` Mauro Carvalho Chehab
2022-06-27 15:28                       ` Liam Howlett
2022-06-27 15:54                         ` Christian Brauner
2022-06-27 16:27                         ` Mark Brown
2022-06-28 10:53                           ` Mauro Carvalho Chehab
2022-06-28 16:13                         ` Luck, Tony
2022-06-27 15:34                   ` Jonathan Corbet
2022-06-27 17:07                     ` Linus Torvalds
2022-07-01  8:48                       ` [PATCH 0/4] Address some issues with sphinx detection Mauro Carvalho Chehab
2022-07-01  8:48                         ` [PATCH 1/4] scripts: sphinx-pre-install: fix venv version check logic Mauro Carvalho Chehab
2022-07-01  8:48                         ` [PATCH 2/4] scripts: sphinx-pre-install: report broken venv Mauro Carvalho Chehab
2022-07-01  8:48                         ` [PATCH 3/4] scripts: sphinx-pre-install: check for PDF min version later on Mauro Carvalho Chehab
2022-07-01  8:48                         ` [PATCH 4/4] scripts: sphinx-pre-install: provide both venv and package installs Mauro Carvalho Chehab
2022-07-02 10:11                       ` [PATCH v2 0/5] Address some issues with sphinx detection Mauro Carvalho Chehab
2022-07-02 10:11                         ` [PATCH v2 1/5] scripts: sphinx-pre-install: fix venv version check logic Mauro Carvalho Chehab
2022-07-02 10:11                         ` [PATCH v2 2/5] scripts: sphinx-pre-install: report broken venv Mauro Carvalho Chehab
2022-07-02 10:11                         ` [PATCH v2 3/5] scripts: sphinx-pre-install: check for PDF min version later on Mauro Carvalho Chehab
2022-07-02 10:11                         ` [PATCH v2 4/5] scripts: sphinx-pre-install: provide both venv and package installs Mauro Carvalho Chehab
2022-07-02 10:11                         ` [PATCH v2 5/5] scripts: sphinx-pre-install: place a warning for Sphinx >= 3.0 Mauro Carvalho Chehab
2022-07-05  4:15                         ` [PATCH v2 0/5] Address some issues with sphinx detection Akira Yokosawa
2022-07-06 14:31                           ` Akira Yokosawa
2022-07-07 20:33                             ` Mauro Carvalho Chehab
2022-07-07 18:45                           ` Jonathan Corbet
2022-07-07 20:25                             ` Mauro Carvalho Chehab
2022-07-07 20:15                           ` Mauro Carvalho Chehab
2022-07-08 11:34                             ` Akira Yokosawa [this message]
2022-07-08 14:02                               ` Expectation to --no-pdf option (was Re: [PATCH v2 0/5] Address some issues with sphinx detection) Jonathan Corbet
2022-07-08 14:59                                 ` Mauro Carvalho Chehab
2022-07-08 15:27                                   ` Akira Yokosawa
2022-07-08 23:01                                     ` Akira Yokosawa
2022-07-09  7:59                                       ` Mauro Carvalho Chehab
2022-07-11 11:23                                         ` Akira Yokosawa
2022-08-01 23:30                         ` [PATCH v2 0/5] Address some issues with sphinx detection Tomasz Warniełło
2022-07-02 10:52                   ` [Ksummit-discuss] [TECH TOPIC] What kernel documentation could be Mauro Carvalho Chehab
2022-06-25 17:43 ` Steven Rostedt
2022-06-25 17:48   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ba5a52e-cab6-05cf-a66e-adc58c467e1f@gmail.com \
    --to=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.