aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/tedoc.tes
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2016-11-16 16:30:46 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2016-11-18 07:25:00 +0100
commitbe39ab9fdbaba118ece1dcc3e064c8452fcdd277 (patch)
tree4436de46028c2a984f6ee27f0fc80b263ebc1448 /doc/tedoc.tes
parentb44a4bae7d5c1098709dfaffd122263e0f4c5bc6 (diff)
downloadsciteco-be39ab9fdbaba118ece1dcc3e064c8452fcdd277.tar.gz
the manual generator (generator-docs.tes) has been cleaned up and is now called tedoc.tes
* some code simplifications * it now supports command line arguments via getopt.tes. * the -C flag enabled C/C++ mode. By default tedoc parses SciTECO code which means it can be used to document macro packages as well. * Therefore it is installed as a separate tool now. It may be used as a Groff preprocessor for third-party macro authors to generate (wo)man pages. * there's a man page tedoc.tes(1) * The troff placeholder macro is now called ".TEDOC". * Help topics can now be specified after the starting comment /*$ or !*$. Topics have been defined for all built-in commands.
Diffstat (limited to 'doc/tedoc.tes')
-rwxr-xr-xdoc/tedoc.tes129
1 files changed, 129 insertions, 0 deletions
diff --git a/doc/tedoc.tes b/doc/tedoc.tes
new file mode 100755
index 0000000..623be3a
--- /dev/null
+++ b/doc/tedoc.tes
@@ -0,0 +1,129 @@
+#!/usr/local/bin/sciteco -m
+!* tedoc.tes [-C] [--] <output> <input> <sources> *!
+
+:EMQ[$SCITECOPATH]/getopt.tes
+
+@[format_header]{
+ FD--S .U.f :L"S.|Z'U.t Q.f,Q.tXa Q.f,Q.tD I^J
+
+ EBQ#tm
+ I\# GENERATED FROM Q.#sc (\.#sc):^J
+ I.SS  Ga -A-10"N I^J '
+ :Q.[topics]">
+ I.SCITECO_TOPIC  G.[topics]
+ '
+
+ EQ.[header]
+ J <FR^J^J.br^J;>
+ J <
+ SMA; .U.t
+ 1Ua <."=1;' -A"A|1;' -A"V -1Ua 1;' R>
+ Qa"S
+ Q.tJ
+ |
+ .,Q.tXa .,Q.tD
+ I^J.B Qa^J
+ '
+ >
+ J <
+ S[MC]; .U.t -S[ .,Q.t-1Xa .-1,Q.tD
+ I^J.RI [ Qa ]^J
+ >
+ J <FR->\(->;>
+ J <
+ SMCM[|MC];
+ .U.t <-A"C|-A-|"N1;'' R>
+ .,Q.tXa .,Q.tD EQa
+ <FR| | ;>
+ EQ.[header]
+ I^J.IR Qa^J
+ >
+ J <FRS^J^J;>
+ J <FR^JS^J;>
+ J <FR^J^J^J;>
+ J 0A-10"=D'
+ ZJ -A-10"=-D'
+ EBQ#tm
+ G.[header]
+ I^J.^J
+}
+
+@[format_body]{
+ I.LP^J
+ <FR^J^J^J.^J.LP^J;>
+ J <FS^J-S^J.IP \(bu 4^J;>
+ J <S^JMD.S; 0L I.IP  FSS 4^J>
+ !* set margin for list paragraphs *!
+ J 0U.n <
+ Z-.-3"<1;'
+ .,.+3:S.LP"S
+ Q.n">
+ 0L I.RE^J 0U.n
+ '
+ |
+ .,.+3:S.IP"S
+ Q.n"=0L I.RS^J %.n '
+ '
+ '
+ :L;
+ >
+ Q.n"> ZJ I^J.RE '
+ J <S<MC>; -D I^J -S< -D I^J.I >
+ J <FRS^J^J;>
+ J <FR^JS^J;>
+ EBN#tm
+ G.c I^J.^J.^J
+}
+
+!* process command-line options *!
+[optstring]C M[getopt]"F (0/0) '
+:Q[getopt.C]"<
+ [comment.start]!* [comment.end]*!
+|
+ [comment.start]/* [comment.end]*/
+'
+LR 0X#ou
+2LR 0X#tm EBN#tm EB L
+[.f
+ <:L;R 0X.f EBQ.f EB L>
+].f
+-EF
+
+I\#
+\# AUTOGENERATED FROM Q#tm
+\# DO NOT EDIT MANUALLY!!!
+\#^J
+
+!* find insertion point *!
+FS^J.TEDOC^J^J
+
+EJ-1<
+ <
+ 2U* EU.#scQ*
+
+ !* extract comment *!
+ SQ[comment.start]$;
+ .-:Q[comment.start]-1U.#sc
+ SQ[comment.end]
+ Q.#sc+:Q[comment.start]+1,.-:Q[comment.end]X.c
+ EQ.c
+ <FS^J^J ^J ;>
+ J <FS^J[S,]*[M[ , ],]^J;>
+ J 0A-10"N X.[topics] K '
+ <0A-10"N 0A- "N 0A-9"N 1; ' ' ' D>
+ ZJ <-A-10"N -A- "N -A-9"N 1; ' ' ' -D>
+
+ !* extract header *!
+ H:FD^J^J"F ZJ '
+ 0,.X.[header] 0,.D
+
+ EQ.[header]
+ :M[format_header]
+ EQ.c
+ :M[format_body]
+ >
+ EF
+>
+
+EWQ#ou
+EX