changeset 28620:45a9dcee45db stable

doc: Short-circuit building txt images for manual (bug #57591). * geometryimages.m, interpimages.m, plotimages.m, sparseimages.m, splineimages.m: Test for "txt" format immediately and dump a description to file rather than invoking graphics system.
author Rik <rik@octave.org>
date Fri, 14 Aug 2020 13:37:07 -0700
parents af302efce502
children 174dc4519e73 d075c2f26d1d
files doc/interpreter/geometryimages.m doc/interpreter/interpimages.m doc/interpreter/plotimages.m doc/interpreter/sparseimages.m doc/interpreter/splineimages.m
diffstat 5 files changed, 33 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/geometryimages.m	Thu Aug 13 18:00:22 2020 -0400
+++ b/doc/interpreter/geometryimages.m	Fri Aug 14 13:37:07 2020 -0700
@@ -24,6 +24,12 @@
 ########################################################################
 
 function geometryimages (d, nm, typ)
+
+  if (strcmp (typ, "txt"))
+    image_as_txt (d, nm);
+    return;
+  endif
+
   set_graphics_toolkit ();
   set_print_size ();
   hide_output ();
@@ -41,8 +47,6 @@
       && any (strcmp (nm, {"voronoi", "griddata", "convhull", "delaunay", ...
                            "triplot"})))
     sombreroimage (outfile, typ, d_typ);
-  elseif (strcmp (typ, "txt"))
-    image_as_txt (d, nm);
   elseif (strcmp (nm, "voronoi"))
     rand ("state", 9);
     x = rand (10, 1);
--- a/doc/interpreter/interpimages.m	Thu Aug 13 18:00:22 2020 -0400
+++ b/doc/interpreter/interpimages.m	Fri Aug 14 13:37:07 2020 -0700
@@ -24,6 +24,12 @@
 ########################################################################
 
 function interpimages (d, nm, typ)
+
+  if (strcmp (typ, "txt"))
+    image_as_txt (d, nm);
+    return;
+  endif
+
   set_graphics_toolkit ();
   set_print_size ();
   hide_output ();
@@ -37,9 +43,7 @@
     d_typ = ["-d", typ];
   endif
 
-  if (strcmp (typ, "txt"))
-    image_as_txt (d, nm);
-  elseif (strcmp (nm, "interpft"))
+  if (strcmp (nm, "interpft"))
     t = 0 : 0.3 : pi; dt = t(2)-t(1);
     n = length (t); k = 100;
     ti = t(1) + [0 : k-1]*dt*n/k;
--- a/doc/interpreter/plotimages.m	Thu Aug 13 18:00:22 2020 -0400
+++ b/doc/interpreter/plotimages.m	Fri Aug 14 13:37:07 2020 -0700
@@ -24,6 +24,12 @@
 ########################################################################
 
 function plotimages (d, nm, typ)
+
+  if (strcmp (typ , "txt"))
+    image_as_txt (d, nm);
+    return;
+  endif
+
   set_graphics_toolkit ();
   set_print_size ();
   hide_output ();
@@ -37,9 +43,7 @@
     d_typ = ["-d", typ];
   endif
 
-  if (strcmp (typ , "txt"))
-    image_as_txt (d, nm);
-  elseif (strcmp (nm, "plot"))
+  if (strcmp (nm, "plot"))
     x = -10:0.1:10;
     plot (x, sin (x));
     xlabel ("x");
--- a/doc/interpreter/sparseimages.m	Thu Aug 13 18:00:22 2020 -0400
+++ b/doc/interpreter/sparseimages.m	Fri Aug 14 13:37:07 2020 -0700
@@ -24,6 +24,12 @@
 ########################################################################
 
 function sparseimages (d, nm, typ)
+
+  if (strcmp (typ, "txt"))
+    txtimages (d, nm, 15, typ);
+    return;
+  endif
+
   set_graphics_toolkit ();
   set_print_size ();
   hide_output ();
@@ -43,8 +49,6 @@
     ## There is no sparse matrix implementation available because
     ## of missing libraries, plot sombreros instead.
     sombreroimage (outfile, typ, d_typ);
-  elseif (strcmp (typ, "txt"))
-    txtimages (d, nm, 15, typ);
   elseif (strcmp (nm, "gplot"))
     A = sparse ([2,6,1,3,2,4,3,5,4,6,1,5],
                 [1,1,2,2,3,3,4,4,5,5,6,6], 1, 6, 6);
--- a/doc/interpreter/splineimages.m	Thu Aug 13 18:00:22 2020 -0400
+++ b/doc/interpreter/splineimages.m	Fri Aug 14 13:37:07 2020 -0700
@@ -24,6 +24,12 @@
 ########################################################################
 
 function splineimages (d, nm, typ)
+
+  if (strcmp (typ, "txt"))
+    image_as_txt (d, nm);
+    return;
+  endif
+
   set_graphics_toolkit ();
   set_print_size ();
   hide_output ();
@@ -37,9 +43,7 @@
     d_typ = ["-d" typ];
   endif
 
-  if (strcmp (typ, "txt"))
-    image_as_txt (d, nm);
-  elseif (strcmp (nm, "splinefit1")) ## Breaks and Pieces
+  if (strcmp (nm, "splinefit1")) ## Breaks and Pieces
     rand ("state", 1);
     randn ("state", 1);
     x = 2 * pi * rand (1, 200);