[WM] How to automatically generate html files from all wmks in a dir

jlm17 at lucent.com jlm17 at lucent.com
Thu Feb 2 12:46:57 GMT 2006


I am trying to have webmake automatically generate html files from a dynamic list of .wmk files. I 
have a <for> loop, but I don't know how to programatically set the values= attribute. I have tried 
these two approaches:

   <content name="file_list">
     <{perl
       @_=`ls -1 *.wmk`;
       chomp(@_);
       $_=join(' ', @_);
       s/\.wmk//g;
       $_;
     }>
   </content>
   <for name="page" values=${file_list}>
   ...

and:


   <for name="page" values=<{perl
       @_=`ls -1 *.wmk`;
       chomp(@_);
       $_=join(' ', @_);
       s/\.wmk//g;
       $_;
       }>
       >
   ...

The perl block gets a list of all of the *.wmk files in a directory, concatenates them into one 
string separated by spaces, and removes the '.wmk' suffix. Now I want to iterate over each value and 
generate an html file. The documenation hints at being able to set a variable and then using that in 
a <for>  directive, but I have not found an example that shows the syntax.

Thanks for any help in advance.


More information about the WebMake-Talk mailing list