linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs'
@ 2022-03-26  7:48 Akira Yokosawa
  2022-03-28 10:26 ` Mauro Carvalho Chehab
  2022-03-28 19:53 ` Jonathan Corbet
  0 siblings, 2 replies; 3+ messages in thread
From: Akira Yokosawa @ 2022-03-26  7:48 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Mauro Carvalho Chehab, linux-doc, linux-kernel, Akira Yokosawa

SVG -> PDF conversion is not required in "make htmldocs".
It is pointless to always warn of a missing converter.
Demote the log message in setupTools() to verbose.

For "make pdfdocs" (or "make latexdocs"), promote the dynamic
message of "include SVG raw" to a warn.
Expand the message and recommend installing Inkscape or
ImageMagick.

Fixes: 8ccd05697a9d ("docs: sphinx/kfigure.py: Use inkscape(1) for SVG -> PDF conversion")
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-doc@vger.kernel.org
---
 Documentation/sphinx/kfigure.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/sphinx/kfigure.py b/Documentation/sphinx/kfigure.py
index 24d2b2addcce..cefdbb7e7523 100644
--- a/Documentation/sphinx/kfigure.py
+++ b/Documentation/sphinx/kfigure.py
@@ -212,7 +212,7 @@ def setupTools(app):
         if convert_cmd:
             kernellog.verbose(app, "use convert(1) from: " + convert_cmd)
         else:
-            kernellog.warn(app,
+            kernellog.verbose(app,
                 "Neither inkscape(1) nor convert(1) found.\n"
                 "For SVG to PDF conversion, "
                 "install either Inkscape (https://inkscape.org/) (preferred) or\n"
@@ -296,8 +296,10 @@ def convert_image(img_node, translator, src_fname=None):
 
         if translator.builder.format == 'latex':
             if not inkscape_cmd and convert_cmd is None:
-                kernellog.verbose(app,
-                                  "no SVG to PDF conversion available / include SVG raw.")
+                kernellog.warn(app,
+                                  "no SVG to PDF conversion available / include SVG raw."
+                                  "\nIncluding large raw SVGs can cause xelatex error."
+                                  "\nInstall Inkscape (preferred) or ImageMagick.")
                 img_node.replace_self(file2literal(src_fname))
             else:
                 dst_fname = path.join(translator.builder.outdir, fname + '.pdf')

base-commit: 8d6451b9a51b555be2c9a6c326a980b2de00741a
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs'
  2022-03-26  7:48 [PATCH] docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs' Akira Yokosawa
@ 2022-03-28 10:26 ` Mauro Carvalho Chehab
  2022-03-28 19:53 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2022-03-28 10:26 UTC (permalink / raw)
  To: Akira Yokosawa; +Cc: Jonathan Corbet, linux-doc, linux-kernel

Em Sat, 26 Mar 2022 16:48:39 +0900
Akira Yokosawa <akiyks@gmail.com> escreveu:

> SVG -> PDF conversion is not required in "make htmldocs".
> It is pointless to always warn of a missing converter.
> Demote the log message in setupTools() to verbose.
> 
> For "make pdfdocs" (or "make latexdocs"), promote the dynamic
> message of "include SVG raw" to a warn.
> Expand the message and recommend installing Inkscape or
> ImageMagick.
> 
> Fixes: 8ccd05697a9d ("docs: sphinx/kfigure.py: Use inkscape(1) for SVG -> PDF conversion")
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: linux-doc@vger.kernel.org

Makes sense to me.

Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org>

> ---
>  Documentation/sphinx/kfigure.py | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/sphinx/kfigure.py b/Documentation/sphinx/kfigure.py
> index 24d2b2addcce..cefdbb7e7523 100644
> --- a/Documentation/sphinx/kfigure.py
> +++ b/Documentation/sphinx/kfigure.py
> @@ -212,7 +212,7 @@ def setupTools(app):
>          if convert_cmd:
>              kernellog.verbose(app, "use convert(1) from: " + convert_cmd)
>          else:
> -            kernellog.warn(app,
> +            kernellog.verbose(app,
>                  "Neither inkscape(1) nor convert(1) found.\n"
>                  "For SVG to PDF conversion, "
>                  "install either Inkscape (https://inkscape.org/) (preferred) or\n"
> @@ -296,8 +296,10 @@ def convert_image(img_node, translator, src_fname=None):
>  
>          if translator.builder.format == 'latex':
>              if not inkscape_cmd and convert_cmd is None:
> -                kernellog.verbose(app,
> -                                  "no SVG to PDF conversion available / include SVG raw.")
> +                kernellog.warn(app,
> +                                  "no SVG to PDF conversion available / include SVG raw."
> +                                  "\nIncluding large raw SVGs can cause xelatex error."
> +                                  "\nInstall Inkscape (preferred) or ImageMagick.")
>                  img_node.replace_self(file2literal(src_fname))
>              else:
>                  dst_fname = path.join(translator.builder.outdir, fname + '.pdf')
> 
> base-commit: 8d6451b9a51b555be2c9a6c326a980b2de00741a



Thanks,
Mauro

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs'
  2022-03-26  7:48 [PATCH] docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs' Akira Yokosawa
  2022-03-28 10:26 ` Mauro Carvalho Chehab
@ 2022-03-28 19:53 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Corbet @ 2022-03-28 19:53 UTC (permalink / raw)
  To: Akira Yokosawa
  Cc: Mauro Carvalho Chehab, linux-doc, linux-kernel, Akira Yokosawa

Akira Yokosawa <akiyks@gmail.com> writes:

> SVG -> PDF conversion is not required in "make htmldocs".
> It is pointless to always warn of a missing converter.
> Demote the log message in setupTools() to verbose.
>
> For "make pdfdocs" (or "make latexdocs"), promote the dynamic
> message of "include SVG raw" to a warn.
> Expand the message and recommend installing Inkscape or
> ImageMagick.
>
> Fixes: 8ccd05697a9d ("docs: sphinx/kfigure.py: Use inkscape(1) for SVG -> PDF conversion")
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: linux-doc@vger.kernel.org
> ---
>  Documentation/sphinx/kfigure.py | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Applied, thanks.

jon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-28 19:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-26  7:48 [PATCH] docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs' Akira Yokosawa
2022-03-28 10:26 ` Mauro Carvalho Chehab
2022-03-28 19:53 ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).