User:Inductiveload/quick pwb
Appearance
The script is at User:Inductiveload/quick pwb.py.
The advantage of this file is you can save the run parameters for another time, it's easier to edit in a text-editor than on a command line and there is basic variable interpolation.
For this to work, pwb.py
must be on your $PATH
.
Input file format
[edit]- Variables can be interpolated into any line
- Set variables like this:
$VAR=value
$_SCRIPT
is special: it sets the PWB script to use. If not given, it'sreplace
- The regexes are Python-style, so use
\1,\2
, etc for references - Lines that start
#
are discarded - Other lines are PWB input arguments, one par line. Variables are interpolated before being passed to PWB
-prefixindex
has the namespace split off, so you can write-prefixindex:Page:Foo.djvu
rather than-namepace:Page -prefixindex:Foo.djvu
- The
-summary
has template names in the form{{template}}
expanded to{{[[Template:template]]}}
so they are linked in the summary.
Every line is either a variable definition or it gets added as a PWB input argument, after any variables are replaced. It looks something like this:
$_SCRIPT=replace $MYVAR=Foo? -prefixindex:Catholic Encyclopedia (1913) -summary:Convert Foo to BaFoor -regex $MYVAR Ba\1r
Environment variables
[edit]You can set some variables in a file called .env
next to this script, or directly using environment variables:
QUICKPWB_PWB_PATH
the directory to findpwb.py
inQUICKPWB_FIX_PATH
a set of paths, separated by colons, to look for fix files in