.TH "strip_stx" "1" "" "Panu A. Kalliokoski" .SH NAME strip_stx \- a simple literate programming tool .SH SYNOPSIS .PP \fCstrip_stx\fP [ -c \fIcommentchars\fP ] [ -B \fIopen\fP \fIclose\fP ] [ \fIfile\fP \fIfile\fP .\|.\|. ] .SH DESCRIPTION .PP \fCstrip_stx\fP takes all structured text (Stx) markup away from the listed \fIfiles\fP, leaving only text in preformatted blocks. If no files are listed, standard input is read instead. The result is written to standard output. .PP This is intended as a simple literate programming tool: programmers may write their programs as documents, processing them with \fCstx2any\fP for documentation and publication but with \fCstrip_stx\fP for compilation / running the code. .PP More information about Stx is on the manpage of \fCstx2any\fP. .SH OPTIONS .RS 3 .TP \&\fC-c \fIcommentchars\fP\fP comment out the non-code portions (text outside preformatted blocks) with the given \fIcommentchars\fP at the beginning of every line. If this option (or the next one) is not given, non-code portions are simply deleted. .TP \&\fC-B \fIopen\fP \fIclose\fP\fP surround the non-code portions with (comment-)opening and closing markers \fIopen\fP and \fIclose\fP respectively. This option can be used together with the \fC-c\fP option. .TP \&\fC--version\fP, \fC-V\fP Just show version information and exit. .TP \&\fC--help\fP, \fC-?\fP Just show a short help message and exit. .RE .SH EXAMPLES .RS 8 .PP \fCstrip_stx parse.py.stx > parse.py\fP .RE .PP Strip documentation away from the source file \fCparse.py.stx\fP, supposedly only leaving python code there. .RS 8 .PP \fCstrip_stx -B '/*' ' */' -c ' * ' my.c.stx > my.c\fP .RE .PP Make a literate C code document into proper C source file, leaving the documentation in neatly-formatted comments. .RS 8 .PP \fCstrip_stx -B 'cat < < EOT' 'EOT' embshell.stx > embshell.sh\fP .RE .PP Turn the document \fCembshell.stx\fP into an \(lqembedded shell\(rq script, where all non-program portions are printed to the standard output when execution reaches them. This is akin to PHP or eperl; but \fCstrip_stx\fP is not really meant for this. There are other options for making embedded scripts, such as defining your own markup for the code portions or handling the program logic with \fCm4\fP within \fCstx2any\fP. .SH SEE ALSO .PP \fCstx2any\fP (1) .SH AUTHOR .PP This page is written by Panu A. Kalliokoski.