I have made a small addition to the css language definition that allows for embedding ruby code in the css. I would like to contribute this addition to the bundle and am not sure of the appropriate way to do so. Can anyone fill me in on the best way to submit bundle updates to the community?
Thanks, Matthew
On 27/7/2006, at 11:33, Matthew Johnson wrote:
I have made a small addition to the css language definition that allows for embedding ruby code in the css. I would like to contribute this addition to the bundle and am not sure of the appropriate way to do so [...]
Generally just sending a patch here is fine.
However, I do not think CSS should color embedded Ruby code by default. Is that used a lot?
It's certainly not something I'd advise; dynamic CSS is a path fraught with danger, and I'd like CSS to be kept unsullied...
On 27/07/06, Allan Odgaard throw-away-1@macromates.com wrote:
On 27/7/2006, at 11:33, Matthew Johnson wrote:
I have made a small addition to the css language definition that allows for embedding ruby code in the css. I would like to contribute this addition to the bundle and am not sure of the appropriate way to do so [...]
Generally just sending a patch here is fine.
However, I do not think CSS should color embedded Ruby code by default. Is that used a lot?
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
It's certainly not something I'd advise; dynamic CSS is a path fraught with danger, and I'd like CSS to be kept unsullied...
However, I do not think CSS should color embedded Ruby code by default. Is that used a lot?
I'm not planning to use it dynamically, rather I plan to use it statically to generate a css file. I want to use erb so I can embed variables in the css file, etc. I actually have a template for a .css.rb file that embeds the css in a here doc which can now have embedded erb using my addition to the css bundle (the Ruby bundle already allows css embedding). I then load the here doc into erb and generate a .css file with the same name next to the .css.rb file when the file is executed. It's a pretty neat way to be able to use variables and simple expressions (for colors, height / width, etc) in a css file.
A bundle with a template and some commands, etc for working with a .css.rb file would be pretty easy to create once the css bundle supports Ruby embedding.
Matthew
Why not just make a second CSS language grammar out of it? This way the CSS purists don't need to worry and it still is easily availably to those who are interested in it. Just add a help file describing what the point of it is plus some pointers to other references on uses and applications…?
Dan
Why not just make a second CSS language grammar out of it? This way the CSS purists don't need to worry and it still is easily availably to those who are interested in it. Just add a help file describing what the point of it is plus some pointers to other references on uses and applications…?
This is certainly possible and I may do it if necessary. The reason I'd prefer not to is that I would then need to keep up with all changes to the CSS language definition to keep my version up to date. Even if I take the time to script it, it's still a bit of a hassle. The patch I have only adds about 10 lines to the CSS bundle and anyone not using the features would never know it was there. In any case, I'll create a patch file and send it to the list and then let the powers that be decide... :)
Regards, Matthew
On Jul 27, 2006, at 8:22 PM, Matthew Johnson wrote:
This is certainly possible and I may do it if necessary. The reason I'd prefer not to is that I would then need to keep up with all changes to the CSS language definition to keep my version up to date. Even if I take the time to script it, it's still a bit of a hassle. The patch I have only adds about 10 lines to the CSS bundle and anyone not using the features would never know it was there. In any case, I'll create a patch file and send it to the list and then let the powers that be decide... :)
You would simply include the CSS language to your bundle via an "include" command, so keeping things up-to-date should be automatic in this case.
Regards, Matthew
Haris
You would simply include the CSS language to your bundle via an "include" command, so keeping things up-to-date should be automatic in this case.
Ideally this would work, but unfortunately with the change I need to make to the language grammar it won't. I found a post on the list where Alan says he wants to make it possible to inject an include into the grammar from outside of it by using a scope selector, but that this will be a post 2.0 feature. So for now, doing what I want requires editing or copying the grammar itself.
Matthew
Why not? Just enter the rules that need to be changed into your new grammar and import the CSS grammar last, this way (if I understand correctly) the rules you changed are overwriting the standard CSS rules, but everything else stays the same. And, for a pretty advanced language grammar as the CSS one - do you expect any major changes coming so you really need to worry about keeping up to date?
Dan