[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <32f8ebfaf2062dda9c23ac9744b66e782ea989eb.1758111077.git.mchehab+huawei@kernel.org>
Date: Wed, 17 Sep 2025 14:15:00 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Jonathan Corbet <corbet@....net>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
"Akira Yokosawa" <akiyks@...il.com>,
"Mauro Carvalho Chehab" <mchehab+huawei@...nel.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH v7 06/24] check-variable-fonts.py: add a helper to display instructions
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@...nel.org>
---
tools/docs/check-variable-fonts.py | 7 +++++++
tools/docs/lib/latex_fonts.py | 8 ++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/tools/docs/check-variable-fonts.py b/tools/docs/check-variable-fonts.py
index 79b28f0f7d85..ae274e7fbbb7 100755
--- a/tools/docs/check-variable-fonts.py
+++ b/tools/docs/check-variable-fonts.py
@@ -12,10 +12,17 @@ Detect problematic Noto CJK variable fonts.
or more details, see lib/latex_fonts.py.
"""
+import argparse
import sys
from lib.latex_fonts import LatexFontChecker
+checker = LatexFontChecker()
+
+parser=argparse.ArgumentParser(description=checker.description(),
+ formatter_class=argparse.RawTextHelpFormatter)
+_=parser.parse_args()
+
msg = LatexFontChecker().check()
if msg:
print(msg)
diff --git a/tools/docs/lib/latex_fonts.py b/tools/docs/lib/latex_fonts.py
index e03412e3947e..0a3ad4995e79 100755
--- a/tools/docs/lib/latex_fonts.py
+++ b/tools/docs/lib/latex_fonts.py
@@ -113,6 +113,9 @@ class LatexFontChecker:
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 +157,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
Powered by blists - more mailing lists