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

Re: [2.0.1] How to get outputfile name?



On Thu, Jun 22, 2000 at 11:46:05AM +0200, Roland Rosenfeld wrote:

> Hi!
> 
> At the moment I create various language versions of my pages using
> shebang headers like this:
> 
> #!wml -o (ALL-LANG_*)+LANG_DE:%BASE.html \
>       -o (ALL-LANG_*)+LANG_EN:%BASE-en.html
> 
> Now I want to write the URL of the created file into the created file
> (like "This is URL http://...").  For this I need a mechanism to find
> out the name of the output file.  Until now I only found how to get
> the inputfile name (using the variables WML_SRC_DIRNAME,
> WML_SRC_FILENAME, WML_SRC_BASENAME), but is there an easy way to get
> the output file name?  Okay, I could implement some magic based using
> the SRC variables and using some slices code like
>  $(WML_SRC_BASENAME)<en: -en>.html 
> or something like this, but this heavily depends on the shebang line
> in the input file (which may change in the future), while I intend to
> implement this in the above include file...
> 
> Any ideas?

Hi Roland,

it is impossible to guess output filenames in general cases, because
they are determined in the last pass (wml_p9_slice).
Have a look at wml::std::lang, especially the <lang:star:slice:> tag.
A shebang line is dynamically created from all defined languages, and is
put at the beginning of the document with diversions.

But take care that playing with wml_p9_slice instead of wml shebang line
prevents WMk from doing its job.

You could also write
  #!wml -o (ALL-LANG_*)+LANG_DE:%BASE-de.html \
        -o (ALL-LANG_*)+LANG_EN:%BASE-en.html
and
  http://domain.com/path/to/<lang:star: $(WML_SRC_BASENAME)-*.html>

-- 
Denis Barbier
WML Maintainer
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com