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

Re: Some help




Powerful answer!.  I vote that this Question and Answer be added to
wml_tutorial.1

Denis Barbier writes:
 > On Wed, 20 Jan 1999, Ismael Olea wrote:
 > 
 > > Hi!
 > > 
 > > 	I've to update a web tree created with wml. I've got a problem: we
 > > mantain a ftp site with a number of docs, each doc is presented in 6
 > > different formats; we need a web page automaticaly generated with urls
 > > to all these files. Can I do this with wml? I know shell scripting but I
 > > prefer an integrated solution.
 > > 
 > > 	Thanks in advance.
 > 
 > Hi,
 > 
 > here is a solution using only pass 2. Keep in mind your html page
 > will be compiled off-line, so you should recompile it everytime
 > a file is added/deleted, or process it through a cron job.
 > 
 > ## List of suffixes
 > <set-var suffixes[]= "doc
 >     txt
 >     sgml
 >     html
 >     ps
 >     dvi">
 > 
 > ## Define the magic command
 > <define-tag list-doc-files>
 > <set-var i=0>
 > <while <get-var suffixes[i]>>
 >       <set-var file="%0.<get-var suffixes[i]>">
 >       <if <get-file-properties <get-var file>>
 >          <prog <a href="<get-var file>"><get-var file></a>>>
 >       <increment i>
 >     </while>
 > </define-tag>
 > 
 > ## Example :
 > <list-doc-files "path/to/foo">
 > 
 > If path/to/foo.txt and path/to/foo.html exist, output is:
 >     <a href="path/to/foo.txt">path/to/foo.txt</a>
 >     <a href="path/to/foo.html">path/to/foo.html</a>
 > 
 > 
 >    Denis
 > 
 > --
 > D. Barbier
 > http://imacs.polytechnique.fr
 > 
 > ______________________________________________________________________
 > Website META Language (WML)                www.engelschall.com/sw/wml/
 > Official Support Mailing List                   sw-wml@engelschall.com
 > Automated List Manager                       majordomo@engelschall.com
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com