[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: [wml] Just some thoughts on WML and type maps / meta files
- From: Fritz Zaucker <nospam@thanx>
- Date: Thu, 19 Jul 2001 17:56:19 +0200 (MEST)
As attachments find .wmkrc and langset.inc (the latter to be included
into your template file(s)) for creation of var-files.
Credit due to Tobias Oetiker (oetiker@ee.ethz.ch)
Cheers,
Fritz
> Just a weird idea I'm actually playing around a little bit:
>
> Would it be useful to add to wml::std::lang the possibility to create
> also meta data files for each output file, e.g. type maps for static
> content negotiation instead of MultiViews (regarding Apache
> mod_negotiation) or meta files for addtional headers with Apache
> mod_cern_meta or CERN HTTPd?
>
> Example: Instead of only outputting index.en.html and index.en.html,
> we also output index.var (type map) or index.en.html.meta and
> index.en.html.meta (meta files).
>
> index.wml:
> 1| #use wml::std:lang
> 2|
> 3| <lang:new id=de short meta>
> 4| <lang:new id=en short meta>
> 5| <lang:star:slice: index.*.html>
> 6|
> 7| Everywhere
> 8| <EN>Foobar</EN>\
> 9| <DE>Schwachfug</DE>
> 10| # Ok, there are more useful HTTP headers to add or modify
> 11| <META:EN>Last-Modification: Wed, 18 Jul 2001 21:49:17 GMT</META:EN>
> 12| <META:DE>Last-Modification: Thu, 19 Jul 2001 21:49:17 GMT</META:DE>
>
> index.en.html:
> 1| Everywhere
> 2| Foobar
>
> index.de.html:
> 1| Everywhere
> 2| Schwachfug
>
> index.en.html.meta:
> 1| Last-Modification: Wed, 18 Jul 2001 21:49:17 GMT
>
> index.de.html.meta:
> 1| Last-Modification: Thu, 19 Jul 2001 12:34:11 GMT
>
> This is useful for SSI documents, of which usually the Apache don't
> send Last-Modification header if you don't the "XBitHack full"
> directive. And I can control the sending of additional headers in the
> source file... :-)
>
> Any comments? Useful? Totally crazy? :-)
>
> BTW: I actually implemented the .meta-Version for working with Apache
> mod_cern_meta using "MetaDir ." and "MetaSuffix .meta". If anyone has
> interest in that version...
>
> Regards, Axel
>
--
Dr. Fritz Zaucker, Head IT Support Group
Department of Electrical Engineering, Federal Institute of Technology
ETZ J97, Gloriastrasse 35, CH-8092 Zurich, Switzerland
Tel.: +41-1-632-5241 Fax: +41-1-632-1194 http://people.ee.ethz.ch/~zaucker/
E-mail: zaucker@ee.ethz.ch (see home page for PGP key)
-o LANG_VAR:%BASE.var
-o (ALL-LANG_*)+LANG_EN:%BASE.en.html@u+x
-o (ALL-LANG_*)+LANG_DE:%BASE.de.html@u+x
#
#
# all definitions in the include rely on the existence of $LANG
#
#
###############################################################################
# define base languages of the document
###############################################################################
#use wml::std::lang
<set-var lntmp=<downcase "$(LANGS)"> />
<while <match <get-var lntmp /> "[a-z][a-z]">>
<set-var lan=<match <get-var lntmp /> "[a-z][a-z]" action=extract> />
<set-var lntmp=<match <get-var lntmp /> "[a-z][a-z]" action=delete> />
<lang:new id=<get-var lan /> short>
</while>
###############################################################################
## creates .var file for automatic language selection
###############################################################################
[LANG_VAR:
URI: $(WML_SRC_BASENAME)
<set-var lntmp=<downcase "$(LANGS)"> />
<while <match <get-var lntmp /> "[a-z][a-z]">>
<set-var lan=<match <get-var lntmp /> "[a-z][a-z]" action=extract> />
<set-var lntmp=<match <get-var lntmp /> "[a-z][a-z]" action=delete> />
<protect></protect>
URI: $(WML_SRC_BASENAME).<get-var lan />.html
Content-type: text/html
Content-language: <get-var lan />
</while>
<protect></protect>
URI: $(WML_SRC_BASENAME).en.html
Content-type: text/html
:LANG_VAR]