gather_stx_titles(1)
π gather_stx_titles π
okay bestie, welcome to a General Commands Manual page β the star of the show is gather_stx_titles, and yes she's a section 1 girlie (general commands, we love her). let's get into it π«Ά
πΈ NAME πΈ
gather_stx_titles β gather title declarations from Stx documents β¨
π SYNOPSIS π
gather_stx_titles [ -f from-suffix ] [ -t to-suffix ] [ m4 options ]
file [ file ... ]
π DESCRIPTION π
so what does she do? gather_stx_titles digs out Stx metadata declarations from the files you list, and dumps the title and document ID information as m4 definitions straight into standard output. then later, w_crosslink can use all that info to link your documents up by their metadata. iconic behaviour, honestly. π
why is this useful tho? okay imagine this: you've got a big site with a LOT of cross-linking. a document's name is gonna show up in so many places β in the link menu (if you have one), and in the body of all the different pages that cross-link to it. gather_stx_titles lets you put all that info in one place, and in the place where it actually belongs: the file itself. and bestie, you will be so glad you did when the time comes to change document titles or move documents around β especially if your website has multilingual magic going on. π§
β¨ OPTIONS β¨
heads up: gather_stx_titles uses m4 internally, so she'll accept any option m4 accepts. on top of those, she takes the following:
-ffrom-suffix β in the filename data, substitute away the suffix from-suffix. and okay, plot twist: from_suffix may actually be a regular expression. stupid but true, bestie π in GNUm4it's a "traditional" regexp, whereas in BSDm4it's an "extended" regexp. defaults to no suffix (nothing to take away).-tto-suffix β in the filename data, substitute the suffix that was taken away by from-suffix with to-suffix. if from-suffix is nil (which is the default), then to-suffix just gets appended to all filenames. π«-pprefix β strip away the prefix given by (regular expression) prefix from filenames. the equivalent of-tfor this one does not exist, because you can specify a directory prefix tow_crosslinkviaw_base. iykyk π€·--version,-Vβ just show version information and exit. short and sweet. π--help,-?β just show a short help message and exit. π
π EXAMPLES π
ngl, most of the time you're gonna want to automate gather_stx_titles β for example, with a Makefile like this one:
SOURCES = $(wildcard *.stx)
TARGETS = $(SOURCES:.stx=.html)
all: $(TARGETS)
titles.m4: $(SOURCES)
gather_stx_titles -f stx -t html $^ > $@
%.html: %.stx titles.m4
stx2any -T html titles.m4 $< > $@
if you don't want to be quite so correct about it, you can drop the .html dependency on titles.m4, or the titles.m4 dependency on SOURCES. π
and using temporary files is not necessary β this should also work:
$ gather_stx_titles *.stx | stx2any - mydoc.stx
π SEE ALSO π
stx2any (1).
π¦ AUTHOR π¦
this page is written by Panu A. Kalliokoski.
okay and that's the whole page bestie, you ate it π
big love to Panu A. Kalliokoski for writing this one, and this was the gather_stx_titles(1) page from the General Commands Manual β now go gather those titles, periodt. πβ¨π
π¦ 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