Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strip_stx(1) [debian man page]

strip_stx(1)						      General Commands Manual						      strip_stx(1)

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

Check Out this Related Man Page

gather_stx_titles(1)					      General Commands Manual					      gather_stx_titles(1)

NAME
gather_stx_titles - gather title declarations from Stx documents SYNOPSIS
gather_stx_titles [ -f from-suffix ] [ -t to-suffix ] [ m4 options ] file [ file ... ] DESCRIPTION
gather_stx_titles digs out Stx metadata declarations from the listed files, and dumps the title and document ID information as m4 defini- tions into standard output. This information can later be used by w_crosslink to link the documents by their metadata. Why is this useful? Well, imagine that you have a large site with a lot of cross-linking. A document's name will appear in many places: in the link menu (if you have one), and in the body of different pages where it is cross-linked from. gather_stx_titles lets you put all the information in one place and where it belongs, i.e. the file itself. You'll be glad if you did, when the time comes to change document titles or move the documents around; especially so if your website has multilingual magic. OPTIONS
gather_stx_titles uses m4 internally and will accept any option m4 accepts. In addition to those, it takes the following options: -f from-suffix In the filename data, substitute away the suffix from-suffix. Actually, from_suffix may be a regular expression; stupid but true, in GNU m4 it is a "traditional" regexp, whereas in BSD m4 it is an "extended" regexp. Default to no suffix (nothing to take away). -t to-suffix In the filename data, substitute the suffix taken away by from-suffix with to-suffix. If from-suffix is nil (the default), append to-suffix to all filenames. -p prefix Strip away the prefix given by (regular expression) prefix from filenames. The equivalent of -t for this does not exist, because you can specify a directory prefix to w_crosslink by w_base. --version, -V Just show version information and exit. --help, -? Just show a short help message and exit. EXAMPLES
I guess most of the time you will want to automate the use of gather_stx_titles, for example with a Makefile like this: SOURCES = $(wildcard *.stx) TARGETS = $(SOURCES:.stx=.html) all: $(TARGETS) titles.m4: $(SOURCES) gather_stx_titles -f stx -t html $^ > $@ %.html: %.stx titles.m4 stx2any -T html titles.m4 $< > $@ If you don't want to be quite so correct, drop the .html dependency on titles.m4 or titles.m4 dependency on SOURCES. Using temporary files is not necessary: this should also work: $ gather_stx_titles *.stx | stx2any - mydoc.stx SEE ALSO
stx2any (1). AUTHOR
This page is written by Panu A. Kalliokoski. Panu A. Kalliokoski gather_stx_titles(1)
Man Page