strip_stx(1)

πŸ“¦ version 1.56, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’… 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 ✨

  • -c commentchars β€” 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. πŸ’€
  • -B open 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 -c option. 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