[Po4a-devel]Config files enhancement

Jordi Vilalta jvprat@wanadoo.es
Sun, 17 Apr 2005 13:24:07 +0200 (CEST)


On Fri, 15 Apr 2005, Martin Quinson wrote:
>  On Fri, Apr 15, 2005 at 01:18:51PM +0200, Jordi Vilalta wrote:
> >  Hi,
> > 
> >  while trying to translate the new website proposal I found the need to add
> >  module options in the config files (a longstanding limitation of the po4a
> >  script). A posible solution came to my mind: we could define "module
> >  aliases". For example, we could define po4aweb to be an alias to the xml
> >  module with some options:
> > 
> >  [po4a_alias: po4aweb] xml -o inline="<a>"
> >  [type: po4aweb] index.xml $lang:index.xml.$lang
> > 
> >  Would it be so difficult to implement it?
> 
>  What about
>  [type: xml] index.xml $lang:index.xml.$lang modopt:inline="<a>"
>  ?
> 
>  It sounds rather simple to implement, too. It would solve the module option
>  issue, as long as you don't want to pass different module options for the
>  different languages.
> 
>  The schema could be extended a bit for the other cases:
>  - language specific module option: modopt_fr and friends?
>  - non-module option such as -k to po4a-translate: no idea. Maybe directly:
>    [type: xml] index.xml $lang:index.xml.$lang modopt:inline="<a>" -k 40

Well, my idea was to be able to reuse the options. Once po4aweb is defined (in 
the example above), there can be lots of documents using this "alias". Maybe we 
could do a mix between both approaches: common options defined as module 
aliases, and file-specific options defined in the file line.

We could use the same syntax (modopt and others) while defining the module 
aliases, being able to do something like:

[po4a_alias: po4aweb] xml modopt:inline="<a>" opt:"-k 0" \
                       opt_fr:"-L iso-8859-1" opt_zh:"-L utf-8"

[type: po4aweb] index.xml $lang:index.xml.$lang
[type: po4aweb] features.xml $lang:features.xml.$lang modopt:inline="<b>"

Just brainstorming :P

Regards,

Jordi Vilalta