strip_stx(1)
π strip_stx β ok bestie, let's talk
Manual page for strip_stx(1), straight outta the General Commands Manual. Buckle up. π
β¨ NAME β¨
strip_stx β a simple literate programming tool. That's it, that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
strip_stx [ -c commentchars ] [ -B open close ] [ file file ... ]
π DESCRIPTION π
Okay so real talk: strip_stx takes all the structured text (Stx) markup away from the files you list, and what's left is only the text sitting inside preformatted blocks. No files listed? Then it just reads from standard input instead, periodt. The result goes to standard output. π
It's meant to be a simple literate programming tool, and honestly? Iconic concept. The idea is that programmers can write their programs as documents, then run them through stx2any for documentation and publicationβ¦ and through strip_stx for compilation / running the code. Same file, two jobs, main character energy fr fr. π
More tea about Stx lives on the manpage of stx2any. Go read it, iykyk.
β¨ OPTIONS β¨
-ccommentchars β comments out the non-code portions (that's the text outside preformatted blocks) by putting the given commentchars at the beginning of every line. And if this option (or the next one) isn't given? The non-code portions just get deleted. Gone. π-Bopen close β surrounds the non-code portions with (comment-)opening and closing markers, open and close respectively. And yes, you can absolutely use this one together with the-coption. Teamwork, slay. π«Ά--version,-Vβ just shows version information and exits. That's the whole job. β¨--help,-?β just shows a short help message and exits. Cute, brief, helpful. πΈ
π EXAMPLES π
strip_stx parse.py.stx > parse.py
Strip the documentation away from the source file parse.py.stx, supposedly only leaving python code there. Clean. Minimal. Obsessed. π
strip_stx -B '/*' ' */' -c ' * ' my.c.stx > my.c
Make a literate C code document into a proper C source file, leaving the documentation in neatly-formatted comments. Ate, no crumbs. π₯
strip_stx -B 'cat < < EOT' 'EOT' embshell.stx > embshell.sh
Turn the document embshell.stx into an "embedded shell" script, where all the non-program portions get printed to standard output when execution reaches them. This is akin to PHP or eperl β but ngl, strip_stx is not really meant for this. There are other options for making embedded scripts, like defining your own markup for the code portions, or handling the program logic with m4 within stx2any. Just so you know, bestie. π
π SEE ALSO π
stx2any(1)
π AUTHOR π
This page is written by Panu A. Kalliokoski. π
Written by Panu A. Kalliokoski, from the General Commands Manual, version strip_stx(1). Byeee, go strip some markup, you've got this. ππ¦π
π¦ where this page comes from
- debian bookworm: stx2any 1.56-2.3
- ubuntu jammy: stx2any 1.56-2.2
- ubuntu noble: stx2any 1.56-2.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms