[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Multiple outputs, one input

On Sat, Dec 23, 2000 at 12:47:56AM -0500, Philip Mak wrote:
> Hello,
> My question is, can I do something similar in WML? Obviously I do not want
> to have to create 35 pages when it should all be doable with 1.

Of course you can generate the 35 pages from a single source file
(*.wml). However, unless you want to mess around with the order of the
passes etc. I think you will have to run wml 35 times (or wmk).  I
have had a similar problem (though on a non-commercial, much
smaller-scale project), and what I did was basically the following:

I have one source file (which reads in templates etc.), and I use a
wrapper script to repeatedly call wml on that sourcefile. The script
is basically:

,----[ w.sh ]
| #!/bin/sh
| force=$1                # should be -f or void
| wml=wmk
| for n in *.wml
| do
|   if [ -r $n ]
|   then
|     l=${n%.wml}
|     for m in "" .c .ct .h .l3
|     do
| 	  $wml $force -P "wml-parify.pl --esperanto" \
| 	       -DDOSIERO=$l -DKODO=$m -o $l$m.html $n
|     done
|   fi
| done

with some extra work to generate indices etc. The *.wml-files have
(Perl) code checking for the variables DOSIERO and KODO (I am
concerned with encodings of Esperanto) and use that information to
generate the related file.

> I would want to be able to use evangelion.wml to generate:
> index.html (thumbnail pages)
> index-2.html
> index-3.html
> index-4.html
> index-5.html
> image-1.html (full-sized image pages)
> image-2.html
> ...
> image-30.html

So your wrapper script would

- have to compute the numbers (5 and 30)

- set two variables, e.g. WHAT (set to index or image) and
  NUMBER (set to 0 for index.html, 1..5 for index-N.html, 1..30
  for image-N.html)

- set the corresponding output file name

- call wmk with those definitions.

Should be easy.



Albert Reiner                                   <areiner@tph.tuwien.ac.at>
Deutsch       *       English       *       Esperanto       *       Latine
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com