List Info

Thread: Directive for altering Genshi/Kid behavior?




Directive for altering Genshi/Kid behavior?
country flaguser name
Germany
2007-07-12 04:14:15
Does Genshi perform expression substitution in processing
instructions 
such as <?xml-stylesheet ... ?> and XML comments? Kid
does not, except 
for certain comments, though it is sometimes useful.

I think a mechanism for explicitly enabling and disabling
expression 
substitution would be helpful here, or more generally a
directive for 
controlling other Kid/Genshi features, something like:

<script
py:use="substitution">...</script>

or

<script
py:pragma="without_substitution">...</script
>

I'd like to implement something like this for Kid, but it
should be 
compatible with Genshi if possible. Does something like this
already 
exist for Genshi? If not, any suggestions for a new syntax?

-- Christoph

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Genshi" group.
To post to this group, send email to genshigooglegroups.com
To unsubscribe from this group, send email to
genshi-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/genshi?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Directive for altering Genshi/Kid behavior?
country flaguser name
Germany
2007-07-12 05:09:36
> I'd like to implement something like this for Kid, but
it should be 
> compatible with Genshi if possible. Does something like
this already 
> exist for Genshi? If not, any suggestions for a new
syntax?

Another idea on the Kid list was to use a specific Template
variable for 
this, e.g. "pragma", which could be a dictionary.
The behavior could 
then be changed like this:

<?python pragma['substitution']=False ?>

We could also add this as a directive:

<div py:pragma="substitution=False"> ...
</div>

would be equivalent to

<div>
<?python _substition_old = pragma['substitution']
pragma['substitution'] = False ?>
...
<?python pragma['substitution'] = _substition_old ?>
</div>

Any better ideas?

-- Christoph

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Genshi" group.
To post to this group, send email to genshigooglegroups.com
To unsubscribe from this group, send email to
genshi-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/genshi?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )