mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	"Akira Yokosawa" <akiyks@gmail.com>,
	"Mauro Carvalho Chehab" <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v8 06/24] check-variable-fonts.py: add a helper to display instructions
Date: Thu, 18 Sep 2025 13:54:40 +0200	[thread overview]
Message-ID: <577162cf4e07de74c4a783f16e3404f0040e5e0a.1758196090.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1758196090.git.mchehab+huawei@kernel.org>

Use lib docstring to output the comments via --help/-h. With
that, update the default instructions to recomment it instead
of asking the user to read the source code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 tools/docs/check-variable-fonts.py | 12 +++++++++++-
 tools/docs/lib/latex_fonts.py      | 13 +++++++++----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/tools/docs/check-variable-fonts.py b/tools/docs/check-variable-fonts.py
index 79b28f0f7d85..c0997d6861dc 100755
--- a/tools/docs/check-variable-fonts.py
+++ b/tools/docs/check-variable-fonts.py
@@ -12,11 +12,21 @@ Detect problematic Noto CJK variable fonts.
 or more details, see lib/latex_fonts.py.
 """
 
+import argparse
 import sys
 
 from lib.latex_fonts import LatexFontChecker
 
-msg = LatexFontChecker().check()
+checker = LatexFontChecker()
+
+parser=argparse.ArgumentParser(description=checker.description(),
+                               formatter_class=argparse.RawTextHelpFormatter)
+parser.add_argument("--deny-vf",
+                    help="XDG_CONFIG_HOME dir containing fontconfig/fonts.conf file")
+
+args=parser.parse_args()
+
+msg = LatexFontChecker(args.deny_vf).check()
 if msg:
     print(msg)
 
diff --git a/tools/docs/lib/latex_fonts.py b/tools/docs/lib/latex_fonts.py
index 81358a70f320..29317f8006ea 100755
--- a/tools/docs/lib/latex_fonts.py
+++ b/tools/docs/lib/latex_fonts.py
@@ -105,14 +105,18 @@ class LatexFontChecker:
     translations.
     """
 
-    def __init__(self):
-        deny_vf = os.environ.get('FONTS_CONF_DENY_VF', "~/deny-vf")
+    def __init__(self, deny_vf=None):
+        if not deny_vf:
+            deny_vf = os.environ.get('FONTS_CONF_DENY_VF', "~/deny-vf")
 
         self.environ = os.environ.copy()
         self.environ['XDG_CONFIG_HOME'] = os.path.expanduser(deny_vf)
 
         self.re_cjk = re.compile(r"([^:]+):\s*Noto\s+(Sans|Sans Mono|Serif) CJK")
 
+    def description(self):
+        return __doc__
+
     def get_noto_cjk_vf_fonts(self):
         """Get Noto CJK fonts"""
 
@@ -154,8 +158,9 @@ class LatexFontChecker:
                 For CJK pages in PDF, they need to be hidden from XeTeX by denylisting.
                 Or, CJK pages can be skipped by uninstalling texlive-xecjk.
 
-                For more info on denylisting, other options, and variable font, see header
-                comments of {rel_file}.
+                For more info on denylisting, other options, and variable font, run:
+
+                    tools/docs/check-variable-fonts.py -h
             """)
         msg += "=" * 77
 
-- 
2.51.0


  parent reply	other threads:[~2025-09-18 11:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 11:54 [PATCH v8 00/24] Split sphinx call logic from docs Makefile Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 01/24] scripts/jobserver-exec: move the code to a class Mauro Carvalho Chehab
2025-09-18 16:58   ` Jonathan Corbet
2025-09-18 17:33     ` Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 02/24] scripts/jobserver-exec: move its class to the lib directory Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 03/24] scripts/jobserver-exec: add a help message Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 04/24] scripts: check-variable-fonts.sh: convert to Python Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 05/24] tools/docs: check-variable-fonts.py: split into a lib and an exec file Mauro Carvalho Chehab
2025-09-18 11:54 ` Mauro Carvalho Chehab [this message]
2025-09-18 11:54 ` [PATCH v8 07/24] scripts: sphinx-pre-install: move it to tools/docs Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 08/24] tools/docs: sphinx-pre-install: drop a debug print Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 09/24] tools/docs: sphinx-pre-install: allow check for alternatives and bail out Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 10/24] tools/docs: python_version: move version check from sphinx-pre-install Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 11/24] tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 12/24] docs: parallel-wrapper.sh: remove script Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 13/24] docs: Makefile: document latex/PDF PAPER= parameter Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 14/24] docs: Makefile: document FONTS_CONF_DENY_VF= parameter Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 15/24] tools/docs: sphinx-build-wrapper: add an argument for LaTeX interactive mode Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 16/24] tools/docs: sphinx-build-wrapper: allow building PDF files in parallel Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 17/24] tools/docs,scripts: sphinx-*: prevent sphinx-build crashes Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 18/24] tools/docs: sphinx-build-wrapper: Fix output for duplicated names Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 19/24] docs: add support to build manpages from kerneldoc output Mauro Carvalho Chehab
2025-09-27 20:35   ` Nicolas Schier
2025-09-29  0:44     ` Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 20/24] tools: kernel-doc: add a see also section at man pages Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 21/24] scripts: kdoc_parser.py: warn about Python version only once Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 22/24] tools/docs: sphinx-build-wrapper: move rust doc builder to wrapper Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 23/24] tools/docs: sphinx-* break documentation bulds on openSUSE Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 24/24] tools/docs: sphinx-build-wrapper: add support to run inside venv Mauro Carvalho Chehab
2025-09-18 17:47 ` [PATCH v8 00/24] Split sphinx call logic from docs Makefile Jonathan Corbet
2025-09-18 19:23   ` Mauro Carvalho Chehab
2025-09-18 19:33     ` Jonathan Corbet
2025-09-18 23:39       ` Mauro Carvalho Chehab
2025-10-17 20:13 ` Jonathan Corbet
2025-10-18 10:41   ` Mauro Carvalho Chehab

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=577162cf4e07de74c4a783f16e3404f0040e5e0a.1758196090.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®