#!/usr/bin/sciteco -m ! ./generate-docs.tes ! ! Preprocess a manpage template, inserting a SciTECO command reference. The .COMMANDS request is replaced with Troff markup generated from code comments in . The comments support a small but powerful markup for documenting TECO commands: * comments start with /*$ * all lines until first empty line are command syntax descriptions * text followed by "--" is a short description * variable values and characters of syntactic significance should be detected automatically * alternatives are denoted by "|" * every line is an alternative * return values may be specified after "->" * the remaining text is the verbose command description * denotes a variable from the syntax description * empty lines introduce paragraphs * lines beginning with "-" are unordered lists * lines beginning with numbers and dot ("1.", "2.", etc.) are ordered lists * the above transformations are only preprocessing, so that Troff requests, escapes and tman macros may also be used. ! @{format_header}{ fd--S .U.f :L"S.|Z'U.t Q.f,Q.tXa Q.f,Q.tD I  ebQ#tm I\# GENERATED FROM Q.#sc ( Q.#sc\ I): .SS Qa -a-10"N I  ' eq.{header} j j qa"Sq.tj|.,q.txa.,q.td i .B Qa '> j j\(->;> j .,q.txa .,q.td eqa eq.{header}i .IR Qa > jjj j 0a-10"=d' zj-a-10"=-d' ebQ#tm g.{header}i .  } @{format_body}{ i.LP  jj ! set margin for list paragraphs ! j 0U.n< Z-.-3"<1;' .,.+3:S.LP"S Q.n">0L I.RE  0U.n' | .,.+3:S.IP"S Q.n"=0L I.RS  %.n' ' ' :L; > Q.n"> ZJ I .RE ' j;-di -s<-di .I > jj ebQ#tm g.ci . .  } ! process command-line options ! LR 0X#ou 2LR 0X#tm EBQ#tm EB L [.f <:L;R 0X.f EBQ.f EB L> ].f -EF I\# \# AUTOGENERATED FROM Q#tm \# DO NOT EDIT MANUALLY!!! \#  ! find insertion point ! FS \#$COMMANDS   < < ! extract comment ! 2EB EQ* HX.#sc 2EB s/*$; .-3u.#sc s*/ q.#sc+3,.-2x.ceq.c ! q.#sc= ! j j<0a-13"=df>'0a-10"=df>'0a- "=df>'0a- "=df>';> zj<-a-13"=-df>'-a-10"=-df>'-a- "=-df>'-a- "=-df>';> ! extract header ! h:fd "Fzj'0,.x.{header}0,.d eq.{header} :M{format_header} eq.c :M{format_body} > EF Q*-1"=1;' > EWQ#ou EX