Re: [Templates] a little text formatting

[prev] [thread] [next] [Date index for 2005/03/15]

From: Darren Chamberlain
Subject: Re: [Templates] a little text formatting
Date: 21:16 on 15 Mar 2005
--LyciRD1jyfeSSjG0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Cahill, Earl <ecahill at corp.untd.com> [2005/03/15 14:09]:
> A start with a line, say
>=20
> This line is really too long.
>=20
> A length, say 25, and suffix, say '...'.  I would like to be able to do
> something like this
>=20
> [% my_truncate(line, 25, '...') %]
>=20
> And end up with=20
>=20
> This line is really t...
>=20
> Just wondering if there is something out there that already does this.

The standard truncate filter does this:

  $ tpage=20
  [% FILTER truncate(25) %]
  This line is really too long.
  [% END %]

  This line is really t...

See L<Template::Manual::Filters> for details.

(darren)

--=20
The secret of life is enjoying the passage of time.
    -- James Taylor

--LyciRD1jyfeSSjG0
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iEYEAREDAAYFAkI3UMAACgkQzsinjrVhZap9zwCeIrGHFs3yHjr9ofMBcKJSRd/x
/hAAn1V1UzK/Z2vqANOwVQeYB+QYiPjY
=98fk
-----END PGP SIGNATURE-----

--LyciRD1jyfeSSjG0--

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] a little text formatting
Cahill, Earl 21:09 on 15 Mar 2005

Re: [Templates] a little text formatting
Darren Chamberlain 21:16 on 15 Mar 2005

Re: [Templates] a little text formatting
Larry Leszczynski 21:17 on 15 Mar 2005

RE: [Templates] a little text formatting
Cahill, Earl 21:24 on 15 Mar 2005

Re: [Templates] a little text formatting
Darren Chamberlain 21:23 on 15 Mar 2005

Re: [Templates] a little text formatting
Brett Sanger 21:29 on 15 Mar 2005

Re: [Templates] a little text formatting
Darren Chamberlain 21:28 on 15 Mar 2005

RE: [Templates] a little text formatting
Cahill, Earl 21:42 on 15 Mar 2005

RE: [Templates] a little text formatting
Jason Gottshall 22:38 on 15 Mar 2005

Generated at 16:59 on 18 Mar 2005 by mariachi v0.52