tcldocstrip - Tcl-based Docstrip Processor
The application described by this document, tcldocstrip, is a relative of docstrip, a simple literate programming tool for LaTeX.
tcldocstrip is based upon the package docstrip.
tcldocstrip was written with the following three use cases in mind.
Conversion of a single input file according to the listed guards into the stripped output. This handles the most simple case of a set of guards specifying a single document found in a single input file.
Stitching, or the assembly of an output from several sets of guards, in a specific order, and possibly from different files. This is the second common case. One document spread over several inputs, and/or spread over different guard sets.
Extraction and listing of all the unique guard expressions and guards used within a document to help a person which did not author the document in question in familiarizing itself with it.
This is the form for use case . It converts the input file according to the specified guards and options. The result is written to the named output file. Usage of the string - as the name of the output signals that the result should be written to stdout. The guards are document-specific and have to be known to the caller. The options will be explained later, in section OPTIONS.
This argument specifies where to write the generated document. It can be the path to a file or directory, or -. The last value causes the application to write the generated documented to stdout.
If the output does not exist then [file dirname $output] has to exist and must be a writable directory.
This argument specifies the path to the file to process. It has to exist, must be readable, and written in docstrip format.
This is the form for use case . It differs from the form for use case  by the possibility of having options before the output file, which apply in general, and specifying more than one inputfile, each with its own set of input specific options and guards.
It extracts data from the various input files, according to the specified options and guards, and writes the result to the given output, in the order of their specification on the command line. Options specified before the output are global settings, whereas the options specified before each input are valid only just for this input file. Unspecified values are taken from the global settings, or defaults. As for form  using the string - as output causes the application to write to stdout. Using the string . for an input file signals that the last input file should be used again. This enables the assembly of the output from one input file using multiple and different sets of guards, without having to specify the full name of the file every time.
This is the form for use case . It determines the guards, and unique guard expressions used within the provided input document. The found strings are written to stdout, one string per line.
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category docstrip of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.
Copyright © 2005 Andreas Kupries <email@example.com>