[TxMt] need guidance on snippets
Brian Landau
brianjlandau at gmail.com
Mon Dec 4 01:07:43 UTC 2006
Hey Lewis,
On 12/3/06, Lewis Overton <akakie at gmail.com> wrote:
> I'm trying to learn about writing useful snippets for things I do often. It
> looks like I need some conceptual help. For example, I use this snippet:
>
> <tr>
> <td><cite>${1:title}</cite></td>
> <td>${2:composer}<br />
> arr:${3:arranger}</td>
> </tr>
> </table>$0
>
> with a tab trigger of </table>
>
> That worked so well I got greedy. I'd like to cause the snippet to force the
> title be Title Case.
>
Can't you just type it out in title case?
Or you could use a class attribute on the td or cite tag and use CSS
to style it with the text-transform property like this:
HTML code:
<td class="title"><cite>song title</cite></td>
CSS code:
td.title {
text-transform: capitalize;
}
that would display the text to the browser like this: Song Title
Otherwise if the text is getting pasted in or something you could do a
transformation on it, see:
http://macromates.com/textmate/manual/snippets#transformations
Hope that helps!
-Brian
More information about the textmate
mailing list