aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-08-03 17:56:04 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-08-03 18:01:34 +0300
commitc5510d684e4879ab9a5295b4a1981888a4268627 (patch)
tree328f1b014af9e546976205e5377dcb8ce8c438d9
parent9f6b229b9b10471233f10fdb50e8a70d5d2789cd (diff)
downloadsciteco-c5510d684e4879ab9a5295b4a1981888a4268627.tar.gz
simplified the htbl.tes preprocessor and the SUBST_MACRO using new --quiet, --stdin and --stdout options
* htbl.tes now reads from stdin and writes to stdout. Allows avoiding temporary `*.htbl` files * grosciteco.tes still cannot be simplified since --stdin cannot be combined with passing command-line arguments (FIXME).
-rw-r--r--bootstrap.am8
-rw-r--r--doc/Makefile.am17
-rwxr-xr-xdoc/htbl.tes9
-rw-r--r--src/Makefile.am2
4 files changed, 15 insertions, 21 deletions
diff --git a/bootstrap.am b/bootstrap.am
index 8bce720..965389f 100644
--- a/bootstrap.am
+++ b/bootstrap.am
@@ -24,8 +24,7 @@ endif
SCITECO_INSTALLED = \
$(bindir)/`echo sciteco | @SED@ '$(transform)'`$(EXEEXT)
-SUBST_MACRO = EB$<\e \
- <FS@PACKAGE^Q@\e@PACKAGE@\e;>J \
+SUBST_MACRO = <FS@PACKAGE^Q@\e@PACKAGE@\e;>J \
<FS@PACKAGE_NAME^Q@\e@PACKAGE_NAME@\e;>J \
<FS@PACKAGE_VERSION^Q@\e@PACKAGE_VERSION@\e;>J \
<FS@PACKAGE_URL^Q@\e@PACKAGE_URL@\e;>J \
@@ -34,12 +33,11 @@ SUBST_MACRO = EB$<\e \
<FS@scitecodatadir^Q@\e$(scitecodatadir)\e;>J \
<FS@scitecolibdir^Q@\e$(scitecolibdir)\e;>J \
<FS@TECO_INTEGER^Q@\e@TECO_INTEGER@\e;>J \
- <FS@DATE^Q@\e$(shell LC_ALL=C @DATE@ "+%d %b %Y")\e;>J \
- EW$@\e
+ <FS@DATE^Q@\e;$(shell LC_ALL=C @DATE@ "+%d %b %Y")\e;>J
# The SciTECO-based substitutor must not process config.h.in.
@top_srcdir@/config.h: ;
SUFFIXES = .in
.in:
- $(SCITECO_MINIMAL) -e $$'$(SUBST_MACRO)'
+ $(SCITECO_MINIMAL) -qioe $$'$(SUBST_MACRO)' <$< >$@
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f69d95f..65f8556 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -52,7 +52,7 @@ CLEANFILES += sciteco.1 sciteco.1.intermediate
EXTRA_DIST += sciteco.1.in
women_DATA += sciteco.7.woman sciteco.7.woman.tec
-CLEANFILES += sciteco.7 sciteco.7.intermediate sciteco.7.in sciteco.7.htbl
+CLEANFILES += sciteco.7 sciteco.7.intermediate sciteco.7.in
EXTRA_DIST += sciteco.7.template
women_DATA += tutorial.woman tutorial.woman.tec
@@ -61,8 +61,9 @@ EXTRA_DIST += tutorial.ms.in
CLEANFILES += $(women_DATA)
-# NOTE: *.intermediate files are only generated since SciTECO scripts
-# cannot currently read stdin, so the grosciteco postprocessor
+# FIXME: *.intermediate files are only generated since SciTECO scripts
+# cannot currently read stdin via --stdin while passing command-line
+# arguments at the same time, so the grosciteco postprocessor
# has to be run on a separate file.
%.woman %.woman.tec : %.intermediate grosciteco.tes
$(SCITECO_FULL) -m -- @srcdir@/grosciteco.tes \
@@ -84,13 +85,9 @@ html_DATA = grosciteco.tes.1.html tedoc.tes.1.html \
CLEANFILES += $(html_DATA)
endif
-# NOTE: The *.htbl files are only generated since SciTECO
-# scripts cannot be integrated into pipelines easily yet.
-%.htbl : % htbl.tes
- $(SCITECO_FULL) -m -- @srcdir@/htbl.tes $< $@
-
-%.html : %.htbl
- @GROFF@ -wall -Thtml -man $< >$@
+%.html : % htbl.tes
+ $(SCITECO_FULL) -qiom -- @srcdir@/htbl.tes <$< | \
+ @GROFF@ -wall -Thtml -man >$@
%.html : %.ms
@GROFF@ -wall -Thtml -ms $< >$@
diff --git a/doc/htbl.tes b/doc/htbl.tes
index 9cd5100..19f81a2 100755
--- a/doc/htbl.tes
+++ b/doc/htbl.tes
@@ -1,11 +1,9 @@
-#!/usr/local/bin/sciteco -m
-!* htbl.tes <input> <output> *!
+#!/usr/local/bin/sciteco -qiom
+!* cat input | htbl.tes >output *!
!* Troff tbl "drop-in" replacement *!
0,2EJ !* FIXME: Memory limiting is too slow *!
-LR 0X#in 2LR 0X#ou EBN#in EB -EF
-
<
!*
* <table> will implicitly close <p>'s so we must recalculate the margin.
@@ -112,5 +110,4 @@ q.[drows]<
I.HTML </table>^J
>
-2EL EWQ#ou
-EX \ No newline at end of file
+2EL -EX
diff --git a/src/Makefile.am b/src/Makefile.am
index ff2e86b..f22802b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -103,6 +103,8 @@ endif
CLEANFILES = $(BUILT_SOURCES) \
symbols-scintilla.c symbols-scilexer.c
+# FIXME: Perhaps symbols-extract.tes should work with --stdin/--stdout.
+# Requires changing the command-line argument passing first.
symbols-scintilla.c : @SCINTILLA_PATH@/include/Scintilla.h \
symbols-extract.tes
$(SCITECO_MINIMAL) -8m -- @srcdir@/symbols-extract.tes \