List Info

Thread: New tutorial available




New tutorial available
country flaguser name
Germany
2007-09-06 05:32:39
Hey folks,

I've finally put together a comprehensive tutorial on using
Genshi at:

   <ht
tp://genshi.edgewall.org/wiki/GenshiTutorial>

(See also: <http://www.cmlenz.net/blog/2007/09/genshi-tutorial.ht
ml>)

Note that this isn't just newbie stuff; I'd strongly
recommend  
everyone interested in improving their usage of Genshi to
check it  
out. Suggestions for what may be missing, or what needs to
be better  
explained are of course welcome. At the end of the page I've
included  
a couple of suggestions for taking the tutorial app even
further--if  
anyone wants to take on those, that'd be awesome.

Cheers,
Chris
--
Christopher Lenz
   cmlenz at gmx.de
   http://www.cmlenz.net/


--~--~---------~--~----~------------~-------~--~----~
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: New tutorial available
country flaguser name
United States
2007-09-11 09:30:37
Is there any difference between
  <py:match path="head"
once="true">
    <head py:attrs="select('*')">

and
  <head py:match="head" once="true"
py:attrs="select('*')">


Also, in order to edit templates ussually one needs this
meta:
  <meta content="text/html; charset=UTF-8"
http-equiv="content-type">
in both the master layout and individiual templates.

How do I make them not repeat in the final result?
(Currently I use py:strip="" in individual
templates).


--~--~---------~--~----~------------~-------~--~----~
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: New tutorial available
country flaguser name
Germany
2007-09-12 04:13:25
Hi Damjan,

Am 11.09.2007 um 16:30 schrieb Damjan:
> Is there any difference between
>   <py:match path="head"
once="true">
>     <head py:attrs="select('*')">
>
> and
>   <head py:match="head"
once="true" py:attrs="select('*')">

Definitely. In the first snippet, you're using py:match as
an  
element. The once="true" attribute belongs to the
py:match element,  
and gets used by the match directive as an optimization hint
 
(although only in current trunk, and the upcoming 0.5
release; in  
0.4.x, the attribute is ignored/discarded)

(see ht
tp://genshi.edgewall.org/wiki/Documentation/xml- 
templates.html#match-templates)

In your second snippet, you're using py:match as an
attribute, and  
the once="true" attribute belongs to the
<head> element. The match  
directive never sees it, and it'll just be passed through
into the  
output.

> Also, in order to edit templates ussually one needs
this meta:
>   <meta content="text/html; charset=UTF-8"
http-equiv="content-type">
> in both the master layout and individiual templates.
>
> How do I make them not repeat in the final result?
> (Currently I use py:strip="" in individual
templates).

Maybe I'm misunderstanding your question, but
py:replace="''" should  
work to remove them, just as py:strip="" should.
Do you want to avoid  
putting the directive in all your templates? I'm not sure
the couple  
of characters saved is worth it, but you'd need to change
your select 
() XPath expressions to be more restrictive.

In general you don't really even need them in the output at
all if  
you're setting the actual Content-Type HTTP header
correctly.

Cheers,
Chris
--
Christopher Lenz
   cmlenz at gmx.de
   http://www.cmlenz.net/


--~--~---------~--~----~------------~-------~--~----~
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-3]

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