[Templates-cvs] cvs commit: Template2/docsrc/lib/misc filters

cvs@template-toolkit.org cvs@template-toolkit.org


cvs         06/01/30 14:59:37

  Modified:    docsrc/lib/misc filters
  Log:
  * added example for truncate() second argument
  
  Revision  Changes    Path
  1.14      +16 -4     Template2/docsrc/lib/misc/filters
  
  Index: filters
  ===================================================================
  RCS file: /template-toolkit/Template2/docsrc/lib/misc/filters,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- filters	2006/01/30 13:43:16	1.13
  +++ filters	2006/01/30 14:59:37	1.14
  @@ -205,11 +205,11 @@
       ME> blah blah blah
       ME> cabbages, rhubard, onions
   
  -=head2 truncate(length)
  +=head2 truncate(length,dots)
   
  -Truncates the text block to the length specified, or a default length of
  -32.  Truncated text will be terminated with '...' (i.e. the '...' falls
  -inside the required length, rather than appending to it).
  +Truncates the text block to the length specified, or a default length
  +of 32.  Truncated text will be terminated with '...' (i.e. the '...'
  +falls inside the required length, rather than appending to it).
   
       [% FILTER truncate(21) %]
       I have much to say on this matter that has previously 
  @@ -219,6 +219,18 @@
   output:
   
       I have much to say...
  +
  +If you want to use something other than '...' you can pass that as a 
  +second argument.
  +
  +    [% FILTER truncate(26, '…') %]
  +    I have much to say on this matter that has previously 
  +    been said on more than one occasion.
  +    [% END %]
  +
  +output:
  +
  +    I have much to say…
   
   =head2 repeat(iterations)