hi, just wondering if anyone has written a command to renumber the ${1:var} items in a snippet? I find myself doing this quite often when developing a new snippet and it is a bit tedious.
Ideally, the command would allow you write a snippet like this
${n:not sure${n:about} the ${n:order) ${n:yet ${n:but that no longer matters}}
and have the command turn it into
${1:not sure${2:about} the ${3:order) ${4:yet ${5:but that no longer matters}}
as well as coping with
${1:not sure${2:about} the ${3:order) ${n:oops, added this!} ${4:yet ${5:but that no longer matters}}
-->
${1:not sure${2:about} the ${3:order) ${4:oops, added this!} ${5:yet ${6:but that no longer matters}}
great idea! if no one has written this I *may* give it a stab when I have time.
On Mon, Aug 11, 2008 at 1:41 AM, Timothy Bates timothy.c.bates@gmail.comwrote:
hi, just wondering if anyone has written a command to renumber the ${1:var} items in a snippet? I find myself doing this quite often when developing a new snippet and it is a bit tedious.
Ideally, the command would allow you write a snippet like this
${n:not sure${n:about} the ${n:order) ${n:yet ${n:but that no longer matters}}
and have the command turn it into
${1:not sure${2:about} the ${3:order) ${4:yet ${5:but that no longer matters}}
as well as coping with
${1:not sure${2:about} the ${3:order) ${n:oops, added this!} ${4:yet ${5:but that no longer matters}}
-->
${1:not sure${2:about} the ${3:order) ${4:oops, added this!} ${5:yet ${6:but that no longer matters}}
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
I posted the query below a few days ago and I'm wondering if I said something offensive-- I haven't heard any responses. My situation isn't dire, but if I violated list etiquette in some way, I'd like to learn from my mistake. If the question isn't within the scope of the list, that would be useful to know too.
Thanks!
Hi, I'm new.
I'm working on a custom Textpattern installation and my client has entered a massive amount of text data in certain fields using UPPERCASE. He wants the text displayed in Title Case instead, and he doesn’t want to manually change it. I can easily use the style declaration "text-transform: capitalize;" for these elements, but my client would very much prefer formal title case in which words such as “the,” “of,” “and,” and “for” are not capitalized. (I see that Textmate’s "Convert to Titlecase" command in the "Text" menu does this correctly.)
I have made a mysql dump of the database, but I'm not sure how to isolate the appropriate data for a text transformation. Here is how each individual record is formatted in the database:
(91,'2008-08-03 05:20:57','author-username','2008-08-03 05:26:33','','UPPERCASE DATA','','','','','','','UPPERCASE-DATA','', 0,'Comment',0,4,1,1,'section-name','','lowercase-data','lowercase- data','','','','','','','','','','','UPPERCASE DATA','','lowercase- data','3p344629nn178n874sp2s222s0q3n072','2008-08-03')
The mysql dump also contains uppercase terms such as "DROP TABLE IF EXISTS" and lowercase terms like "datetime" and "varchar" that I _don't_ want changed. Is there a simple way to target just the UPPERCASE DATA fields enclosed in single quotes for a massive "Covert to Titlecase"?
I welcome advice from regular expression fu-masters and Textmate adepts!
Thanks in advance! John Stephens
I can't help you with your question (not that great with regex's) but I don't think you offended anyone, sometimes questions slip through unanswered. not sure why.
On Mon, Aug 11, 2008 at 12:16 PM, John Stephens john@designop.us wrote:
I posted the query below a few days ago and I'm wondering if I said something offensive-- I haven't heard any responses. My situation isn't dire, but if I violated list etiquette in some way, I'd like to learn from my mistake. If the question isn't within the scope of the list, that would be useful to know too.
Thanks!
Hi, I'm new.
I'm working on a custom Textpattern installation and my client has entered a massive amount of text data in certain fields using UPPERCASE. He wants the text displayed in Title Case instead, and he doesn't want to manually change it. I can easily use the style declaration "text-transform: capitalize;" for these elements, but my client would very much prefer formal title case in which words such as "the," "of," "and," and "for" are not capitalized. (I see that Textmate's "Convert to Titlecase" command in the "Text" menu does this correctly.)
I have made a mysql dump of the database, but I'm not sure how to isolate the appropriate data for a text transformation. Here is how each individual record is formatted in the database:
(91,'2008-08-03 05:20:57','author-username','2008-08-03 05:26:33','','UPPERCASE DATA','','','','','','','UPPERCASE-DATA','', 0,'Comment',0,4,1,1,'section-name','','lowercase-data','lowercase- data','','','','','','','','','','','UPPERCASE DATA','','lowercase- data','3p344629nn178n874sp2s222s0q3n072','2008-08-03')
The mysql dump also contains uppercase terms such as "DROP TABLE IF EXISTS" and lowercase terms like "datetime" and "varchar" that I _don't_ want changed. Is there a simple way to target just the UPPERCASE DATA fields enclosed in single quotes for a massive "Covert to Titlecase"?
I welcome advice from regular expression fu-masters and Textmate adepts!
Thanks in advance! John Stephens
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Thanks, Nick. I appreciate your feedback.
On Aug 11, 2008, at 7:16 PM, Nick wrote:
I can't help you with your question (not that great with regex's) but I don't think you offended anyone, sometimes questions slip through unanswered. not sure why.
On Mon, Aug 11, 2008 at 12:16 PM, John Stephens john@designop.us wrote:
I posted the query below a few days ago and I'm wondering if I said something offensive-- I haven't heard any responses. My situation isn't dire, but if I violated list etiquette in some way, I'd like to learn from my mistake. If the question isn't within the scope of the list, that would be useful to know too.
Thanks!
Hi, I'm new.
I'm working on a custom Textpattern installation and my client has entered a massive amount of text data in certain fields using UPPERCASE. He wants the text displayed in Title Case instead, and he doesn't want to manually change it. I can easily use the style declaration "text-transform: capitalize;" for these elements, but my client would very much prefer formal title case in which words such as "the," "of," "and," and "for" are not capitalized. (I see that Textmate's "Convert to Titlecase" command in the "Text" menu does this correctly.)
I have made a mysql dump of the database, but I'm not sure how to isolate the appropriate data for a text transformation. Here is how each individual record is formatted in the database:
(91,'2008-08-03 05:20:57','author-username','2008-08-03 05:26:33','','UPPERCASE DATA','','','','','','','UPPERCASE-DATA','', 0,'Comment',0,4,1,1,'section-name','','lowercase-data','lowercase- data','','','','','','','','','','','UPPERCASE DATA','','lowercase- data','3p344629nn178n874sp2s222s0q3n072','2008-08-03')
The mysql dump also contains uppercase terms such as "DROP TABLE IF EXISTS" and lowercase terms like "datetime" and "varchar" that I _don't_ want changed. Is there a simple way to target just the UPPERCASE DATA fields enclosed in single quotes for a massive "Covert to Titlecase"?
I welcome advice from regular expression fu-masters and Textmate adepts!
Thanks in advance! John Stephens
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
I'm working on a custom Textpattern installation and my client has entered a massive amount of text data in certain fields using UPPERCASE. He wants the text displayed in Title Case instead, and he doesn’t want to manually change it. I can easily use the style declaration "text-transform: capitalize;" for these elements, but my client would very much prefer formal title case in which words such as “the,” “of,” “and,” and “for” are not capitalized. (I see that Textmate’s "Convert to Titlecase" command in the "Text" menu does this correctly.)
I have made a mysql dump of the database, but I'm not sure how to isolate the appropriate data for a text transformation. Here is how each individual record is formatted in the database:
(91,'2008-08-03 05:20:57','author-username','2008-08-03 05:26:33','','UPPERCASE DATA','','','','','','','UPPERCASE-DATA','', 0,'Comment',0,4,1,1,'section-name','','lowercase-data','lowercase- data','','','','','','','','','','','UPPERCASE DATA','','lowercase- data','3p344629nn178n874sp2s222s0q3n072','2008-08-03')
The mysql dump also contains uppercase terms such as "DROP TABLE IF EXISTS" and lowercase terms like "datetime" and "varchar" that I _don't_ want changed. Is there a simple way to target just the UPPERCASE DATA fields enclosed in single quotes for a massive "Covert to Titlecase"?
My suggestion would be to write a script that pipes the offending fields through John Gruber's TitleCase.pl script and updates the table.
He has posted it here: http://daringfireball.net/2008/05/title_case
—Alex
Thanks, Alex! A similar option recently became possible using a Textpattern plugin: http://forum.textpattern.com/viewtopic.php?id=27994
On Aug 11, 2008, at 7:55 PM, Alex Ross wrote:
I'm working on a custom Textpattern installation and my client has entered a massive amount of text data in certain fields using UPPERCASE. He wants the text displayed in Title Case instead, and he doesn’t want to manually change it. I can easily use the style declaration "text-transform: capitalize;" for these elements, but my client would very much prefer formal title case in which words such as “the,” “of,” “and,” and “for” are not capitalized. (I see that Textmate’s "Convert to Titlecase" command in the "Text" menu does this correctly.)
I have made a mysql dump of the database, but I'm not sure how to isolate the appropriate data for a text transformation. Here is how each individual record is formatted in the database:
(91,'2008-08-03 05:20:57','author-username','2008-08-03 05:26:33','','UPPERCASE DATA','','','','','','','UPPERCASE-DATA','', 0,'Comment',0,4,1,1,'section-name','','lowercase-data','lowercase- data','','','','','','','','','','','UPPERCASE DATA','','lowercase- data','3p344629nn178n874sp2s222s0q3n072','2008-08-03')
The mysql dump also contains uppercase terms such as "DROP TABLE IF EXISTS" and lowercase terms like "datetime" and "varchar" that I _don't_ want changed. Is there a simple way to target just the UPPERCASE DATA fields enclosed in single quotes for a massive "Covert to Titlecase"?
My suggestion would be to write a script that pipes the offending fields through John Gruber's TitleCase.pl script and updates the table.
He has posted it here: http://daringfireball.net/2008/05/title_case
—Alex
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
so here's a first attempt at a script to rewrite snippet ${1:placeholders}
It works on multi-line snippets, and handles renumbering the paired $n tokens to match the new number of their master
Let me know what you think. When writing snippets you can use random distinct 1 or two digit numbers in your numbering, or (if you don't yet have matching slave elements, then just ${n:
The command will clean up the numbering, so you are free to reorder and nest snippets tokens.
tim
On 11 Aug 2008, at 9:41 AM, Timothy Bates wrote:
${n:not sure${n:about} the ${n:order) ${n:yet ${n:but that no longer matters}} --> ${1:not sure${2:about} the ${3:order) ${4:yet ${5:but that no longer matters}}
${1:not sure${2:about} the ${3:order) ${n:oops, added this!} ${4:yet ${5:but that no longer matters}} --> ${1:not sure${2:about} the ${3:order) ${4:oops, added this!} ${5:yet ${6:but that no longer matters}}