tcldocstrip(n)
π tcldocstrip(n) β Textprocessing toolbox π
okay bestie, sit down, grab a boba, because we're about to talk about tcldocstrip, a Tcl-based Docstrip Processor. yes it lives in the Textprocessing toolbox and yes it's about to become your new obsession. β¨
πΈ NAME πΈ
tcldocstrip β a Tcl-based Docstrip Processor. that's the whole vibe. π
β¨ SYNOPSIS β¨
three whole ways to call this queen, and you're gonna want to know all of them:
tcldocstrip output ?options? input ?guards?
tcldocstrip ?options? output (?options? input guards)...
tcldocstrip -guards input
π¦ DESCRIPTION π¦
so the app this doc is describing, tcldocstrip, is a relative of docstrip β which is a simple literate programming tool for LaTeX. family reunion energy fr fr. π«Ά
and heads up: tcldocstrip is based upon the package docstrip. like, that's its whole foundation. periodt.
π USE CASES π
tcldocstrip was written with these three use cases in mind. not two. not four. three. iconic.
- 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. lowkey the baby version. πΌ
- 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. it's giving craft project but make it code. π§΅
- 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. basically a "who wrote this and what does it even do" rescue mission. ππ
π COMMAND LINE π
tcldocstrip output ?options? input ?guards?
this is the form for use case [1]. it converts the input file according to the specified guards and options. the result gets written to the named output file. using 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 (that's you, bestie, no cap). the options get explained later, down in the OPTIONS section. π
path output(in) β this argument specifies where to write the generated document. it can be the path to a file or directory, or-. that last value makes the application write the generated documented tostdout.
ngl if the output does not exist then [file dirname $output] has to exist and must be a writable directory. no writable dir, no output. π
path inputfile(in) β this argument specifies the path to the file to process. it has to exist, must be readable, and written in docstrip format. non-negotiable. π
tcldocstrip ?options? output (?options? input guards)...
this is the form for use case [2]. it differs from the form for use case [1] 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. yes, options on options. slay. β¨
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 [1], 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. the . is the main character here honestly. π
tcldocstrip -guards input
this is the form for use case [3]. 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. cute, tidy, one per line. π
π OPTIONS π
this section describes all the options available to the user of the application, with the exception of the option -guards. that one was already described, up in COMMAND LINE. so don't come for me. π
-metaprefixstring β this option is inherited from the commanddocstrip::extractprovided by the packagedocstrip.
it specifies the string by which the '%%' prefix of a metacomment line will be replaced. defaults to '%%'. for Tcl code this would typically be '#'. so if you're writing Tcl, you know what to do. π
-onerrormode β this option is inherited from the commanddocstrip::extractprovided by the packagedocstrip.
it controls what will be done when a format error in the text being processed is detected. the settings are:
ignoreβ just ignore the error; continue as if nothing happened. living in denial, but make it a feature. πputsβ write an error message tostderr, then continue processing. honest but unbothered. πthrowβ throw an error.::errorCodeis set to a list whose first element isDOCSTRIP, second element is the type of error, and third element is the line number where the error is detected. this is the default. dramatic and specific, as she should be. π₯
-trimlinesbool β this option is inherited from the commanddocstrip::extractprovided by the packagedocstrip.
controls whether spaces at the end of a line should be trimmed away before the line is processed. defaults to true. bye bye trailing whitespace. β¨
-preambletext-postambletext-nopreamble-nopostambleβ the-no*ambleoptions deactivate file pre- and postambles altogether, whereas the-*ambleoptions specify the user part of the file pre- and postambles. this part can be empty, in that case only the standard parts are shown. this is the default. πΈ
preambles, when active, are written before the actual content of a generated file. in the same manner postambles are, when active, written after the actual content of a generated file. before and after. sandwich structure. π₯ͺ
π BUGS, IDEAS, FEEDBACK π
this document, and the package it describes, will undoubtedly contain bugs and other problems. not me admitting it but okay, honesty is a vibe.
please report such in the category docstrip of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. please also report any ideas for enhancements you may have for either package and/or documentation. we want the ideas bestie, give them to us. π«Ά
when proposing code changes, please provide unified diffs, i.e the output of diff -u. that's the format. don't freestyle it. π
note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. left-most button. remember it. π
π SEE ALSO π
docstrip
β KEYWORDS β
\.dtx, LaTeX, conversion, docstrip, documentation, literate programming, markup, source
π CATEGORY π
Documentation tools
π COPYRIGHT π
Copyright (c) 2005 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page bestie, no cap. this was tcldocstrip(n) from tcllib, version 1.0 β mwah, go strip some docs, you ate. πβ¨π¦
π¦ where this page comes from
- alpine 3.24: tcl-lib-doc 1.21-r1 Β· BSD-2-Clause
- epel 9: tcllib 1.21-1.el9 Β· BSD
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- opensuse-leap 16.0: tcllib 1.21-bp160.1.2 Β· TCL
- Copyright (c) 2005 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms