[TUHS] Proliferation of options is great simplification of pipes, really?

Steffen Nurpmeso steffen at sdaoden.eu
Tue Feb 23 10:24:41 AEST 2021


Robert Clausecker wrote in
 <YDPX3sDuIQzjCrXL at fuz.su>:
 |> I can imagine a simple perl (or python or whatever) script that would run
 |> through groff input, determine which preprocessors are *actually* needed,
 |> and set up a pipeline to run through (only) the needed preprocessors \
 |> in the
 |> proper order. I wouldn't have to tell groff what preprocessors I \
 |> think are
 |> needed, and groff wouldn't have to change (although my script would) when
 |> another preprocessor comes into existence. Modern processors are fast
 |> enough, and groff input small enough, that the "extra" pass wouldn't be
 |> burdensome. And it would take the burden off me to remember exactly which
 |> preprocessors are essential. -- jpl
 |
 |I'm not sure if it would be that simple.  With preprocessors like
 |soelim, your script would have to be able to open arbitrary external
 |files to find out what preprocessors are needed.  And perhaps other
 |preprocessors too could trigger dependencies on additional
 |preprocessors depending on how they are used.

Newer incarnations of man(1) support a shebang-alike control line
<^'\" >followed by concat of [egprtv]+ and include $MANROFFSEQ
content into this list, then do

   case "${preproc_arg}" in
                  e)      pipeline="$pipeline | $EQN" ;;
                  g)      GRAP  ;; # Ignore for compatibility.
                  p)      pipeline="$pipeline | $PIC" ;;
                  r)      pipeline="$pipeline | $REFER" ;;
                  t)      pipeline="$pipeline | $TBL" ;;
                  v)      pipeline="$pipeline | $VGRIND" ;;
                  *)      usage ;;
                  esac

(I copied all this from 2014 text, do not ask me no questions.)
It would make very much sense to extend this syntax for roff
usage, so that document creators can define how manual consumers
generate the result.  This should/could include specification and
thus automatic adjustment of the used character set.
The problem with pipes is that they are academic.  You can write
wrapper scripts or shell functions or for simple cases even
aliases to give the desire a name, but it does not fit pretty well
the all-graphical shader-improved wiping experience people now
have.  You also want good manuals and a shell with a good history
feature and a nice line editor and possibly tabulator completion,
just in case you have forgotten something or made an error or are
too lazy to type that much.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the TUHS mailing list