Skip to contentSkip to conversation

docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs'

PATCH Applied Akira Yokosawa 3 participants 3 messages Mar 26, 2022 – Mar 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs'

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")
Cc Jonathan Corbet <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 Documentation/sphinx/kfigure.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Documentation/sphinx/kfigure.py +5 -3
index 24d2b2addcce..cefdbb7e7523 100644
@@ -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

Signature · 1 line
2.25.1
maintainer Acked-by on v1 1/1
#1 lore raw

Em Sat, 26 Mar 2022 16:48:39 +0900
Akira Yokosawa <[email protected]> escreveu:

Quoted 9 lines

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.

Quoted 5 lines
Fixes 8ccd05697a9d ("docs: sphinx/kfigure.py: Use inkscape(1) for SVG -> PDF conversion")
Cc Jonathan Corbet <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>

Makes sense to me.

Quoted 31 lines
---
 Documentation/sphinx/kfigure.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Documentation/sphinx/kfigure.py +5 -3
index 24d2b2addcce..cefdbb7e7523 100644
@@ -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')
Quoted 1 line

base-commit: 8d6451b9a51b555be2c9a6c326a980b2de00741a

Thanks,
Mauro

maintainer Applied
#2 lore raw
In reply to Akira Yokosawa
Quoted 9 lines · 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.

Quoted 8 lines
Fixes 8ccd05697a9d ("docs: sphinx/kfigure.py: Use inkscape(1) for SVG -> PDF conversion")
Cc Jonathan Corbet <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
---
 Documentation/sphinx/kfigure.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Applied, thanks.

jon