WML(1)
π WML β Website META Language π
okay bestie, sit down, hydrate, because this one is a whole toolkit and we're gonna get through it together π«Ά
version: 2.32.0 β yes she has a version, she's official π
β¨ SYNOPSIS β¨
wml [-I PATH] [-i PATH] [-D NAME=STR] [-D NAME~PATH] [-n] [-r] [-O
level] [-o [SLICETERM":"]PATH[@CHMODOPT]] [-P PATH] [-E PATH] [-t] [-p
STR] [-W STR] [-s] [-v [NUM]] [-q] [inputfile]
wml [-V [NUM]] [-h]
πΈ DESCRIPTION πΈ
so. this is the control program of the Website META Language β aka WML β which is a free HTML generation toolkit for Unix, and internally it's literally 9 independent languages all vibing together. nine. languages. one command. the multitasking is giving main character energy fr π
the whole idea? a sequential filtering scheme where each of those 9 languages handles exactly one of 9 processing passes. so wml reads your inputfile (or from stdin if inputfile is a dash, or if it's just... not there at all π), runs passes 1-9 on it β or only the passes you picked with -p β and then spits out one or more output files. that's the pipeline, that's the vibe. β¨
want the full lore? go read the WML Introduction under wml_intro(7) and the WML Tutorial under wml_tutorial(7). both iconic, both worth it π
π OPTIONS π
-I,--include=PATHβ adds a directory to the list of user include paths. use this one to set up the runtime environment for pass 1. more deets live inwml_p1_ipp(1)π-i,--includefile=PATHβ pre-loads a specific include file, which basically means it virtually drops a
#include "PATH"
at the very top of inputfile. perfect for auto-including your default user include files. now, if you wanna include a system include file you gotta wrap the PATH in angle brackets β like use `"-i" "<foo/bar.wml>"` to pull in foo/bar.wml from the system include area. or you can use the special syntax `"wml::foo::bar"` exactly like you would with the #use directive. your choice, both slay π¦
-D,--define=NAME=STRβ defines a variable, and that variable can be interpolated in pass 1 (IPP) via"$(NAME)", in pass 2 (mp4h) via<"get-var NAME">, in pass 3 (ePerl) via"<:=$NAME:>", and in pass 4 (GNU m4) via"m4_NAME". and there's a special variant β--define=NAME=UNDEFβ that does the opposite: it deletes previous definitions. and heads up, that may not be the same as just undefining those variables, e.g. with system defined variables. sneaky but useful π-D,--define=NAME~PATHβ same energy as the above, except the variable holds a pathname that gets autoadjusted (see below). interpolates exactly the same ways as the"NAME=STR"variant up there β¬οΈ-n,--noshebangβ forces WML to ignore a possibly contained shebang line in inputfile. usually WMk is the one using this, because WMk already parsed that line and handed the options over to WML itself. teamwork π€-r,--norcfileβ forces WML to ignore all.wmlrcfiles. every single one. no cap π-c,--nocdβ when WML processes an input file from another directory, it jumps into that directory before parsing.wmlrcfiles, then jumps back to the current directory after. but if this option is set, no directory change happens at all and.wmlrcfiles get read relative to the current working directory instead. (yes, "reative" is in the original, we're keeping the typo, it's canon now π)-O,--optimize=NUMβ the optimization option, passed directly to pass 8 (htmlfix). it controls how much optimization/stripping gets applied to the generated HTML markup code. less markup = more slay β¨-o,--outputfile=SLICETERM:outputfile[@CHMODOPT]β redirects the output to a file. normally the whole file goes to stdout (same as"ALL:-"). you can use this option more than once to output to more than one file, using the SLICETERM as a set theory term of slices to figure out which contents go into each particular output file. the optional CHMODOPT is for specifying options for a finally appliedchmodcommand β for instance use`"u+x"`to create a file with the execution bit set (that's Apache's XBitHack feature, iykyk). seeslice(1)for more details π-P,--prolog=PATHβ runs a prolog filter over the input file. this program receives the data to act on as STDIN and has to produce the filtered data on STDOUT. that's the deal, no negotiating π«Ά-E,--epilog=PATHβ runs an epilogue program over the finally resulting output files. currently the following WML-specific programs are known:htmlinfo,linklint,tidyandweblint. but honestly you can specify any program available in your"PATH". this program receives the file to act on as its first command line argument. β οΈ notice that output is not redirected to this file, so you have to use a wrapper or program specific flags if you actually want to modify output files. read that twice bestie.-t,--settimeβ sets the modification time of all output files to the modification time of intputfile plus 1 second. why? because webservers generate"Last-Modified"headers, and there the editing time matters more than the generation time. and that 1 second offset? it's for the dependencies of Makefiles. thoughtful, honestly π-M,--depend[=OPTIONS]β outputs a rule suitable formakedescribing the dependencies of each output file, exactly likegccdoes. it only makes sense when the-ooption is used. no processing is done except for the first pass.
the D flag option writes the rule to a dependency file. the name of this file is obtained by replacing the suffix of the output file by ".d".
the M flag option deletes the system files from the list of dependencies. π§
-p,--pass=STRβ specifies which of the passes described above actually get applied at runtime. the argument STR is a comma-separated list of pass numbers, with one special case: you can write"X-Y"for all passes"X...Y". when pass 9 isn't part of STR, the resulting output gets written to STDOUT. default is the string`"1-9"`β so like, everything, by default π-W,--passoption=NUM,STRβ sets option STR for the pass NUM. that's it, that's the whole thing π―-s,--safeβ this disables some Perl hacks inside WML that speed up processing by reducing the forking overhead when running the various passes.
without this option, WML pre-compiles the passes 1, 5, 6, 7, 8 (which are written in Perl!) into a different namespace of the currently running Perl interpreter instead of running them externally via "system()". the effect is that these programs run from within the same Perl interpreter, thus saving five CPU- and time-intensive "fork()"s. the actual gain is between 2 and 4 seconds of processing time. and yeah, experience showed it works great β but the theoretical problem is still there: this approach is somewhat risky due to internal Perl variable conflicts. π
so use this option to disable those speedups and force WML to use the safe "fork()" approach instead. safety first, bestie π‘οΈ
-v,--verbose[=NUM]β sets verbose mode (from 1 to 9), where some processing information gets shown on the console. so useful for debugging. this option also gets passed to some of the filtering programs. default is no verbosity, and just-vmeans-v1π-q,--quietβ sets quiet mode, where the processing prop is no longer displayed. use this when runningwmlas a batch job. and fun fact: this option is automatically forced when inputfile is missing β in that case WML automatically reads from stdin in quiet mode. she's polite like that π-V,--version[=NUM]β gives the version identification string and disclaimer (no NUM, or NUM >= 1), the WML build information (NUM >= 2) and the Perl build information (NUM >= 3). use this to get a brief description of your installed WML system β especially when reporting bugs to the author. they need the receipts, bestie π§Ύ-h,--helpβ prints the usage summary page. the classic. the icon π
π ENVIRONMENT π
DEFINED VARIABLES
these variables are always defined by wml at runtime, and are usually interpolated via <"get-var NAME"> inside Pass 2 and via $NAME in Pass 3. so many of them. all yours. enjoy π
WML_SRC_DIRNAMEβ the current working directory from wherewmlwas started. an absolute Unix filesystem path.WML_SRC_FILENAMEβ the name of the inputfile from the command line. super useful when runningwmlon a bulk of files and include files have to determine in which they are included.WML_SRC_BASENAMEβ the basename of the inputfile, i.e. the"WML_SRC_FILENAME", but with the extension already stripped. clean βοΈWML_SRC_TIMEβ the last modification time of inputfile in"time()"format. useful inside footers when a customized date format is needed.WML_SRC_CTIMEβ the last modification time of inputfile in"ctime()"format. useful inside footers include files.WML_SRC_ISOTIMEβ the last modification time of inputfile in ISO"yyyy-mm-dd hh:mm:ss"format. useful inside footers include files.WML_SRC_USERNAMEβ the Unix username of the user who own inputfile.WML_SRC_REALNAMEβ the realname of the user who own inputfile.WML_GEN_TIMEβ the current time of generation in"time()"format. useful inside footers when a customized date format is needed.WML_GEN_CTIMEβ the current time of generation in"ctime()"format. useful inside footers include files.WML_GEN_ISOTIMEβ the current time of generation in ISO"yyyy-mm-dd hh:mm:ss"format. useful inside footers include files.WML_GEN_USERNAMEβ the Unix username of the user who runs thewmlprocess.WML_GEN_REALNAMEβ the realname of the user who runs thewmlprocess.WML_GEN_HOSTNAMEβ the name of the host on which thewmlcommand runs. π₯οΈWML_LOC_PREFIXβ the location prefix where WML was installed to at built time.WML_LOC_BINDIRβ the directory where WML's binaries were installed to at built time.WML_LOC_LIBDIRβ the directory where WML's library files were installed to at built time.WML_LOC_MANDIRβ the directory where WML's manual pages were installed to at built time.WML_VERSIONβ the version identification string of WML. use this for instance in HTML comments inside header includes to identify the generation tools version. so meta of her π
USED VARIABLES
"WMLOPTS"β this variable can contain a string of options. usually it's used by Bourne-Shell users like
$ WMLOPTS="-DNAME1=VALUE2 -DNAME2=VALUE2"
$ export WMLOPTS
and by C-Shell users like
$ setenv WMLOPTS "-DNAME1=VALUE2 -DNAME2=VALUE2"
to make sure some variables are defined for all runs of wml. set it once, forget it, live your life β¨
"PAGER"β this variable contains the pager WML is to use. WML uses a pager when called with the--verbose=NUMor-vNUMoption respectively, and NUM is 3 or higher, and therefore showing the processed data after each pass. default is'more'. π"TMPDIR"β this variable contains the directory WML stores its temporary files in. default is'/tmp'. ποΈ
<div align="center">β¨ π π¦ to be continued, bestie π¦ π β¨</div>
π USER FILES π
Okay so bestie, you also got these user files: $HOME/.wmlrc and (../)*.wmlrc. These files can also contain option strings, one option per line. Usually the contents is one or more -D options, especially auto-adjusted ones:
-DROOTREL~.
-DROOTABS=http://thishost/thisarea/
:
-DNAME1=VALUE1
-DNAME2=VALUE2
:
π STANDARD INCLUDE FILES β¨
WML is shipped with a standard set of include files. You can directly include them via
#use wml::category::name
and read their own documentation via
$ man wml::category::name
See wml::all(3) for a description of all available include files. Slay.
π SPECIAL FEATURES π
The WML control frontend provides a few special features on its own:
Shebang Line Support πβ¨
WML recognizes a shebang line ("#!wml" options) in the .wml files and automatically adds options to its command line. This line is also used by WMk. Two special features in contrast to shebang lines for the Unix loader are available: WML's shebang line can be continued via a backslash character and the constructs %DIR and %<BASE> are interpolated (where %DIR is the path to the directory the source while resides and %BASE is the filename of the source file without any extension).
Example:
#!wml -o (ALL-LANG_*)+LANG_EN:%BASE.en.html \
-o (ALL-LANG_*)+LANG_DE:%BASE.de.html
Data Protection Container Tag π‘οΈπ
WML provides an own internal container tag named <protect [pass=SPEC]>...</protect> which can be used to protect any type of data from being processed by any WML pass. When no pass attribute is given SPEC defaults to 1-9. When you use pass then SPEC can be either #-, -#, #-# or a comma separated list of passes, while # can be between 1 and 9.
Example:
<script language="JavaScript">
<protect pass=2>
...
output = "<PRE><DIV ALIGN=\"CENTER\"><B>" + help_string + "</B></DIV></PRE>"
...
</protect>
</script>
Warning:
Since WML 2.0.3, pass 1 includes extra stuff to help keeping information about line numbers relevant (a la cpp). So when writing
<protect pass=2>
#include 'foo'
</protect>
these extra commands will not be interpreted during pass 2 and will remain on output. To suppress them, either compile with -W1,-N flag, or write
<protect pass=2>
#include 'foo' IPP_NOSYNCLINES
</protect>
π AUTHORS π
Ralf S. Engelschallrse@engelschall.comwww.engelschall.comDenis Barbierbarbier@engelschall.com
π SEE ALSO π¦
wmd(1), wml_faq(7), wml_intro(7), wml_tutorial(7), wml_tags(7), wml::all(3).
That's the whole vibe check, bestie. This iconic page is from EN Tools, dated 2020-11-29, and it's WML(1) β periodt. π
β¨
π¦ where this page comes from
- debian bookworm: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- debian trixie: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- ubuntu jammy: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- ubuntu noble: wml 2.32.0~ds1-1 Β· GPL-2.0-or-later
- ubuntu questing: wml 2.32.0~ds1-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms