tcldocstrip(1)
π tcldocstrip β the manual, but make it cute π
okay bestie, so this is tcldocstrip(1) from the Textprocessing toolbox, and honestly? she's a whole vibe. a Tcl-based Docstrip Processor, no cap. let's get into it π«Ά
β¨ NAME β¨
tcldocstrip β Tcl-based Docstrip Processor π
β¨ SYNOPSIS β¨
tcldocstrip output ?options? input ?guards?
tcldocstrip ?options? output (?options? input guards)...
tcldocstrip -guards input
three whole forms, three whole moods, we love a flexible queen π
β¨ DESCRIPTION β¨
so the app this doc is yapping about, tcldocstrip, is a relative of docstrip β which is, like, a simple literate programming tool for LaTeX. think of them as cousins at the same family reunion πΈ
and tcldocstrip itself is based upon the package docstrip. periodt.
π USE CASES π
she was written with these three use cases in mind, and honestly, valid:
- 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. one file, one vibe check, done π
- 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, fr fr. one document spread over several inputs, and/or spread over different guard sets. it's giving β¨collageβ¨
- 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. iykyk β it's the "hey bestie, what even is in here" mode π
β¨ 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 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 (scroll down babes, i promise i didn't forget).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 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. like, that's the rules π
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. no ghost files, no unreadable mess, and no random format bestie πΈ
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. the way she just... scales π«Ά
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. . is the "same as before, bestie" of file names, and it's iconic π
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. just a little list, a little receipt, a little "here's what's inside" π
β¨ OPTIONS β¨
this section describes all the options available to the user of the application, with the exception of the option -guards. that option was described already, in section COMMAND LINE. so don't come for me, she already had her moment π
-metaprefix stringβ 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 %% isn't your aesthetic, you can swap her out β¨
-onerror modeβ 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. denial as a lifestyle, honestly πputsβ write an error message to stderr, then continue processing. she said "noted" and kept going π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. she's dramatic and she's correct ππ₯
-trimlines boolβ 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. trailing whitespace, we do not know her π§
-preamble textβ sets the user part of the file preamble. scroll down one bullet for the full lore π-postamble textβ sets the user part of the file postamble. same deal, keep reading bestie πΈ-nopreambleβ deactivates the file preamble altogether, no preamble content for you π-nopostambleβ deactivates the file postamble altogether, no postamble content for you π
so, the -no*amble options deactivate file pre- and postambles altogether, whereas the -*amble options 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. so like, empty is fine, empty is the norm, empty is default behavior β¨
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, top and bottom, the sandwich of it all π₯ͺ
π BUGS, IDEAS, FEEDBACK π
this document, and the package it describes, will undoubtedly contain bugs and other problems. (she's honest, she's self-aware, she's growth-oriented π)
please report such in the category docstrip of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist](http://core.tcl.tk/tcllib/reportlist). please also report any ideas for enhancements you may have for either package and/or documentation. we love ideas, we love feedback, we love a proactive bestie π«Ά
when proposing code changes, please provide unified diffs, i.e the output of diff -u.
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. yes, that specific button. the left-most one. she knows the one π
π 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 thing, bestie!! this was tcllib version 1.0 of tcldocstrip(1), brought to you by the Textprocessing toolbox, and yes she ate. go strip some docs, guard your guards, and remember: . means "same as last time" and - means stdout. mwah ππβ¨
π¦ where this page comes from
- debian bookworm: tcllib 1.21+dfsg-1 Β· BSD
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu jammy: tcllib 1.20+dfsg-1 Β· BSD
- ubuntu noble: tcllib 1.21+dfsg-1 Β· BSD
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· 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